From ae0e7bbc23cbe93ce7da9535911ed82c01e1d06d Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 29 Nov 2022 20:14:41 -0500 Subject: [PATCH] fix bug where context cancels early, resulting in missing providers returned --- query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query.go b/query.go index 0761a1c4a..1a6ef266d 100644 --- a/query.go +++ b/query.go @@ -391,7 +391,7 @@ func (q *query) terminate(ctx context.Context, cancel context.CancelFunc, reason // queryPeer does not access the query state in queryPeers! func (q *query) queryPeer(ctx context.Context, ch chan<- *queryUpdate, p peer.ID) { defer q.waitGroup.Done() - dialCtx, queryCtx := ctx, ctx + dialCtx, queryCtx := ctx, q.ctx // dial the peer if err := q.dht.dialPeer(dialCtx, p); err != nil {