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:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user