refactor(bitswap) move wantlist to loop receive

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow 2014-11-19 23:11:58 -08:00 committed by Jeromy
parent cc92ec3d9c
commit b13a5a940b

View File

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