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 committed Jun 1, 2020
1 parent 98c5089 commit c390fb7
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 @@ -402,7 +402,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 @@ -413,6 +412,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 c390fb7

Please sign in to comment.