Skip to content

Commit

Permalink
dont count connection times in usefulness
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshkshah1992 authored and Stebalien committed Jul 21, 2021
1 parent 35cca9a commit 23a315d
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 23a315d

Please sign in to comment.