Fix shuffle of #638
This commit is contained in:
parent
bc318084f4
commit
fd59cbc7a9
|
@ -492,7 +492,7 @@ method publish*(g: GossipSub,
|
||||||
g.replenishFanout(topic)
|
g.replenishFanout(topic)
|
||||||
fanoutPeers = g.fanout.getOrDefault(topic).toSeq()
|
fanoutPeers = g.fanout.getOrDefault(topic).toSeq()
|
||||||
|
|
||||||
fanoutPeers.shuffle()
|
g.rng.shuffle(fanoutPeers)
|
||||||
if fanoutPeers.len + peers.len > g.parameters.d:
|
if fanoutPeers.len + peers.len > g.parameters.d:
|
||||||
fanoutPeers.setLen(g.parameters.d - peers.len)
|
fanoutPeers.setLen(g.parameters.d - peers.len)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue