Skip to content

Commit

Permalink
added randomness to peer selection
Browse files Browse the repository at this point in the history
  • Loading branch information
SionoiS committed Oct 16, 2024
1 parent 3321fd0 commit 4c05860
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ proc selectPeer*(
if shard.isSome():
peers.keepItIf((it.enr.isSome() and it.enr.get().containsShard(shard.get())))

shuffle(peers)

# No criteria for selecting a peer for WakuRelay, random one
if proto == WakuRelayCodec:
# TODO: proper heuristic here that compares peer scores and selects "best" one. For now the first peer for the given protocol is returned
Expand Down

0 comments on commit 4c05860

Please sign in to comment.