1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-02 03:28:25 +08:00

refac(bitswap) extract const

This commit is contained in:
Brian Tiger Chow
2014-09-18 19:54:30 -07:00
parent 9a18fd6354
commit 74e81e06fa

View File

@ -63,9 +63,12 @@ type bitswap struct {
// GetBlock attempts to retrieve a particular block from peers within the
// deadline enforced by the context
//
// TODO ensure only one active request per key
func (bs *bitswap) Block(ctx context.Context, k u.Key) (*blocks.Block, error) {
provs_ch := bs.routing.FindProvidersAsync(ctx, k, 20)
const maxProviders = 20
provs_ch := bs.routing.FindProvidersAsync(ctx, k, maxProviders)
blockChannel := make(chan blocks.Block)