From 12f2a87de30aa020cbab64a78fa0061989357fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 25 Apr 2019 01:17:11 +0200 Subject: [PATCH] kademlia: turn exception into warning --- eth/p2p/kademlia.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eth/p2p/kademlia.nim b/eth/p2p/kademlia.nim index 21f711a..999c2a4 100644 --- a/eth/p2p/kademlia.nim +++ b/eth/p2p/kademlia.nim @@ -189,7 +189,9 @@ proc removeNode(r: var RoutingTable, n: Node) = r.bucketForNode(n).removeNode(n) proc addNode(r: var RoutingTable, n: Node): Node = - doAssert(n != r.thisNode) + if n == r.thisNode: + warn "Trying to add ourselves to the routing table", node = n + return let bucket = r.bucketForNode(n) let evictionCandidate = bucket.add(n) if not evictionCandidate.isNil: