@cryptotaxi247 / kubo / commits / b13a5a940

refactor(bitswap) move wantlist to loop receive

License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Nov 19, 2014 at 23:11 UTC b13a5a940b40e6b24c1031275905dc763e667c2e
1 file changed +3
exchange/bitswap/bitswap.go
+3
@@ -178,6 +178,9 @@ func (bs *bitswap) run(ctx context.Context) {
178 }
179 case ks := <-bs.batchRequests:
180 // TODO: implement batching on len(ks) > X for some X
181 + for _, k := range ks {
182 + bs.wantlist.Add(k)
183 + }
184 if len(ks) == 0 {
185 log.Warning("Received batch request for zero blocks")
186 continue