mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 17:36:38 +08:00
fix(bitswap/network): return when context is done
@jbenet @whyrusleeping This bug (missing return) could tie up the client worker and cause operations to come to a halt.
This commit is contained in:

committed by
Juan Batiz-Benet

parent
64cb32dadd
commit
05d8c80c39
@ -107,6 +107,7 @@ func (bsnet *impl) FindProvidersAsync(ctx context.Context, k util.Key, max int)
|
||||
bsnet.host.Peerstore().AddAddresses(info.ID, info.Addrs)
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case out <- info.ID:
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user