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