1
0
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:
Brian Tiger Chow
2015-01-03 17:15:05 -05:00
committed by Juan Batiz-Benet
parent 64cb32dadd
commit 05d8c80c39

View File

@ -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:
}
}