@cryptotaxi247 / kubo / commits / 7c2053c3c

fix(bitswap/loop) add to wantlist just once

oops set Add is idempotent but it's a waste of resources License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Nov 20, 2014 at 18:14 UTC 7c2053c3c84439c351591934f2928ecc2db5a701
1 file changed -3
exchange/bitswap/bitswap.go
-3
@@ -188,9 +188,6 @@ func (bs *bitswap) run(ctx context.Context) {
188 }
189 case ks := <-bs.batchRequests:
190 // TODO: implement batching on len(ks) > X for some X
191 - for _, k := range ks {
192 - bs.wantlist.Add(k)
193 - }
191 if len(ks) == 0 {
192 log.Warning("Received batch request for zero blocks")
193 continue