Skip to content

Commit 06918c8

Browse files
authored
Merge pull request #660 from libp2p/feat/no-connection-time-usefulness
Dont count connection times in usefulness
2 parents 35cca9a + 23a315d commit 06918c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ func (q *query) queryPeer(ctx context.Context, ch chan<- *queryUpdate, p peer.ID
393393
defer q.waitGroup.Done()
394394
dialCtx, queryCtx := ctx, ctx
395395

396-
startQuery := time.Now()
397396
// dial the peer
398397
if err := q.dht.dialPeer(dialCtx, p); err != nil {
399398
// remove the peer if there was a dial failure..but not because of a context cancellation
@@ -404,6 +403,7 @@ func (q *query) queryPeer(ctx context.Context, ch chan<- *queryUpdate, p peer.ID
404403
return
405404
}
406405

406+
startQuery := time.Now()
407407
// send query RPC to the remote peer
408408
newPeers, err := q.queryFn(queryCtx, p)
409409
if err != nil {

0 commit comments

Comments
 (0)