From 87c8608d8b94e48bbf7d76fbd2162866752f1867 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Fri, 25 Jan 2019 10:58:37 +0200 Subject: [PATCH] Fixed out of range error in randomPeerWith --- eth_p2p.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth_p2p.nim b/eth_p2p.nim index 3503c13..5b881bf 100644 --- a/eth_p2p.nim +++ b/eth_p2p.nim @@ -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()