diff --git a/bitswap/client/internal/providerquerymanager/providerquerymanager.go b/bitswap/client/internal/providerquerymanager/providerquerymanager.go index 09bfc5b4e..6c846af29 100644 --- a/bitswap/client/internal/providerquerymanager/providerquerymanager.go +++ b/bitswap/client/internal/providerquerymanager/providerquerymanager.go @@ -378,8 +378,8 @@ func (npqm *newProvideQueryMessage) debugMessage() string { func (npqm *newProvideQueryMessage) handle(pqm *ProviderQueryManager) { requestStatus, ok := pqm.inProgressRequestStatuses[npqm.k] if !ok { - - ctx, cancelFn := context.WithCancel(pqm.ctx) + // used the passed in context to FindProvidersAsync for this call + ctx, cancelFn := context.WithCancel(npqm.ctx) requestStatus = &inProgressRequestStatus{ listeners: make(map[chan peer.ID]struct{}), ctx: ctx,