From 0424a66aa21fde39fc275befa8d3be207fa8f533 Mon Sep 17 00:00:00 2001 From: Miran Date: Wed, 24 Jun 2020 16:06:07 +0200 Subject: [PATCH] fix deprecated 'rand' (#259) --- eth/p2p/kademlia.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/p2p/kademlia.nim b/eth/p2p/kademlia.nim index 764a420..4d288b1 100644 --- a/eth/p2p/kademlia.nim +++ b/eth/p2p/kademlia.nim @@ -496,9 +496,9 @@ proc randomNodes*(k: KademliaProtocol, count: int): seq[Node] = # insignificant compared to the time it takes for the network roundtrips when connecting # to nodes. while len(seen) < count: - let bucket = k.routing.buckets.rand() + let bucket = k.routing.buckets.sample() if bucket.nodes.len != 0: - let node = bucket.nodes.rand() + let node = bucket.nodes.sample() if node notin seen: result.add(node) seen.incl(node)