1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 03:19:47 +08:00

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>
This commit is contained in:
Steven Allen
2017-10-17 15:37:46 -07:00
parent d840f67e0a
commit 37296d3958

View File

@ -159,7 +159,9 @@ func (s *Session) run(ctx context.Context) {
case blk := <-s.incoming:
s.tick.Stop()
s.addActivePeer(blk.from)
if blk.from != "" {
s.addActivePeer(blk.from)
}
s.receiveBlock(ctx, blk.blk)