Fix shuffle of #638

This commit is contained in:
Tanguy 2022-02-21 17:00:18 +01:00
parent bc318084f4
commit fd59cbc7a9
No known key found for this signature in database
GPG Key ID: 7DD8EC6B6CE6C45E
1 changed files with 1 additions and 1 deletions

View File

@ -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)