From 37296d395894856f586165a0389d52e76a236909 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 17 Oct 2017 15:37:46 -0700 Subject: [PATCH] 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 --- exchange/bitswap/session.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exchange/bitswap/session.go b/exchange/bitswap/session.go index 7e55bb5e96d..e2236eda6bf 100644 --- a/exchange/bitswap/session.go +++ b/exchange/bitswap/session.go @@ -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)