Skip to content

Commit

Permalink
remove: case of completed optprov lookup
Browse files Browse the repository at this point in the history
I observed that the network size estimation is not correct for the
optprov case in comparison to the classic-only measurement. I think the
reason lies in the function that got removed here.
  • Loading branch information
dennis-tra committed Dec 9, 2022
1 parent 36d41c7 commit f6da739
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lookup_estim.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/libp2p/go-libp2p-kad-dht/netsize"
"github.com/libp2p/go-libp2p-kad-dht/qpeerset"
kb "github.com/libp2p/go-libp2p-kbucket"
"github.com/libp2p/go-libp2p/core/peer"
ks "github.com/whyrusleeping/go-keyspace"
"gonum.org/v1/gonum/mathext"
Expand Down Expand Up @@ -160,17 +159,6 @@ func (dht *IpfsDHT) GetAndProvideToClosestPeers(outerCtx context.Context, key st
// wait until a threshold number of RPCs have completed
es.waitForRPCs()

if outerCtx.Err() == nil && lookupRes.completed { // likely the "completed" field is false but that's not a given

// tracking lookup results for network size estimator as "completed" is true
if err = dht.nsEstimator.Track(key, lookupRes.closest); err != nil {
logger.Warnf("network size estimator track peers: %s", err)
}

// refresh the cpl for this key as the query was successful
dht.routingTable.ResetCplRefreshedAtForID(kb.ConvertKey(key), time.Now())
}

return outerCtx.Err()
}

Expand Down

0 comments on commit f6da739

Please sign in to comment.