Fixed out of range error in randomPeerWith

This commit is contained in:
Yuriy Glukhov 2019-01-25 10:58:37 +02:00 committed by zah
parent 94d4ff50ad
commit 87c8608d8b
1 changed files with 1 additions and 1 deletions

View File

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