提交 74e81e06 作者: Brian Tiger Chow

refac(bitswap) extract const

上级 9a18fd63
...@@ -63,9 +63,12 @@ type bitswap struct { ...@@ -63,9 +63,12 @@ type bitswap struct {
// GetBlock attempts to retrieve a particular block from peers within the // GetBlock attempts to retrieve a particular block from peers within the
// deadline enforced by the context // 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) { 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) blockChannel := make(chan blocks.Block)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论