filter out "" from active peers in bitswap sessions
We use "" to indicate that the block came from the local node. There's no reason to record "" as an active peer (doesn't really *hurt* but still...). License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Oct 17, 2017 at 15:37 UTC
37296d395894856f586165a0389d52e76a236909
1 file changed
+3
-1
exchange/bitswap/session.go
+3
-1
@@ -159,7 +159,9 @@ func (s *Session) run(ctx context.Context) {
159
case blk := <-s.incoming:
160
s.tick.Stop()
161
162
- s.addActivePeer(blk.from)
162
+ if blk.from != "" {
163
+ s.addActivePeer(blk.from)
164
+ }
165
166
s.receiveBlock(ctx, blk.blk)
167