mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 14:33:12 +00:00
added randomness to peer selection (#3123)
This commit is contained in:
parent
086820a49b
commit
6cfa477817
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user