kademlia: turn exception into warning

This commit is contained in:
Ștefan Talpalaru 2019-04-25 01:17:11 +02:00
parent d0d09559b8
commit 12f2a87de3
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
1 changed files with 3 additions and 1 deletions

View File

@ -189,7 +189,9 @@ proc removeNode(r: var RoutingTable, n: Node) =
r.bucketForNode(n).removeNode(n) r.bucketForNode(n).removeNode(n)
proc addNode(r: var RoutingTable, n: Node): Node = 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 bucket = r.bucketForNode(n)
let evictionCandidate = bucket.add(n) let evictionCandidate = bucket.add(n)
if not evictionCandidate.isNil: if not evictionCandidate.isNil: