Skip to content

Commit

Permalink
Merge pull request #660 from libp2p/feat/no-connection-time-usefulness
Browse files Browse the repository at this point in the history
Dont count connection times in usefulness
  • Loading branch information
Stebalien authored Jul 21, 2021
2 parents 35cca9a + 23a315d commit 06918c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ func (q *query) queryPeer(ctx context.Context, ch chan<- *queryUpdate, p peer.ID
defer q.waitGroup.Done()
dialCtx, queryCtx := ctx, ctx

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

startQuery := time.Now()
// send query RPC to the remote peer
newPeers, err := q.queryFn(queryCtx, p)
if err != nil {
Expand Down

0 comments on commit 06918c8

Please sign in to comment.