From f6da739d46d4de0c256f9309d2f789b5cc94af22 Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Wed, 7 Dec 2022 17:36:36 +0100 Subject: [PATCH] remove: case of completed optprov lookup 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. --- lookup_estim.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lookup_estim.go b/lookup_estim.go index 3842b596d..e6e2b5e6d 100644 --- a/lookup_estim.go +++ b/lookup_estim.go @@ -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" @@ -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() }