mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 08:47:52 +08:00
refactor(bitswap) move wantlist to loop receive
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
cc92ec3d9c
commit
b13a5a940b
@ -178,6 +178,9 @@ func (bs *bitswap) run(ctx context.Context) {
|
||||
}
|
||||
case ks := <-bs.batchRequests:
|
||||
// TODO: implement batching on len(ks) > X for some X
|
||||
for _, k := range ks {
|
||||
bs.wantlist.Add(k)
|
||||
}
|
||||
if len(ks) == 0 {
|
||||
log.Warning("Received batch request for zero blocks")
|
||||
continue
|
||||
|
||||
Loading…
Reference in New Issue
Block a user