mirror of
https://github.com/status-im/nim-eth-p2p.git
synced 2025-02-03 02:23:30 +00:00
Fixed out of range error in randomPeerWith
This commit is contained in:
parent
94d4ff50ad
commit
87c8608d8b
@ -159,5 +159,5 @@ proc randomPeerWith*(node: EthereumNode, Protocol: type): Peer =
|
||||
for p in node.peers(Protocol):
|
||||
candidates.add(p)
|
||||
if candidates.len > 0:
|
||||
return candidates[rand(candidates.len)]
|
||||
return candidates.rand()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user