mirror of https://github.com/vacp2p/nim-libp2p.git
fix badly merged code in gossipsub.colocationFactor
This commit is contained in:
parent
eac6cd3dbf
commit
c1d8317e3c
|
@ -47,10 +47,6 @@ proc colocationFactor(g: GossipSub, peer: PubSubPeer): float64 =
|
||||||
address = peer.sendConn.observedAddr
|
address = peer.sendConn.observedAddr
|
||||||
|
|
||||||
g.peersInIP.mgetOrPut(address, initHashSet[PubSubPeer]()).incl(peer)
|
g.peersInIP.mgetOrPut(address, initHashSet[PubSubPeer]()).incl(peer)
|
||||||
if address notin g.peersInIP:
|
|
||||||
g.peersInIP[address] = initHashSet[PubSubPeer]()
|
|
||||||
g.peersInIP[address].incl(peer)
|
|
||||||
|
|
||||||
let
|
let
|
||||||
ipPeers = g.peersInIP[address]
|
ipPeers = g.peersInIP[address]
|
||||||
len = ipPeers.len.float64
|
len = ipPeers.len.float64
|
||||||
|
|
Loading…
Reference in New Issue