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…
Reference in New Issue