From c1d8317e3c46234459102d94f7b60f9f048e6637 Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni <7008900+sinkingsugar@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:39:57 +0900 Subject: [PATCH] fix badly merged code in gossipsub.colocationFactor --- libp2p/protocols/pubsub/gossipsub/scoring.nim | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libp2p/protocols/pubsub/gossipsub/scoring.nim b/libp2p/protocols/pubsub/gossipsub/scoring.nim index 53865f4..fa8daae 100644 --- a/libp2p/protocols/pubsub/gossipsub/scoring.nim +++ b/libp2p/protocols/pubsub/gossipsub/scoring.nim @@ -47,10 +47,6 @@ proc colocationFactor(g: GossipSub, peer: PubSubPeer): float64 = address = peer.sendConn.observedAddr g.peersInIP.mgetOrPut(address, initHashSet[PubSubPeer]()).incl(peer) - if address notin g.peersInIP: - g.peersInIP[address] = initHashSet[PubSubPeer]() - g.peersInIP[address].incl(peer) - let ipPeers = g.peersInIP[address] len = ipPeers.len.float64