diff --git a/codexdht/private/eth/p2p/discoveryv5/protocol.nim b/codexdht/private/eth/p2p/discoveryv5/protocol.nim index 14f0fd1..0bd93e5 100644 --- a/codexdht/private/eth/p2p/discoveryv5/protocol.nim +++ b/codexdht/private/eth/p2p/discoveryv5/protocol.nim @@ -986,8 +986,7 @@ proc revalidateNode*(d: Protocol, n: Node) {.async.} = # Request new SPR let nodes = await d.findNode(n, @[0'u16]) if nodes.isOk() and nodes[].len > 0: - if d.addNode(nodes[][0]): - d.trackedFutures.add(d.removeIfClientMode(nodes[][0])) + discard d.addNode(nodes[][0]) # Get IP and port from pong message and add it to the ip votes trace "pong rx", n, myip = res.ip, myport = res.port diff --git a/codexdht/private/eth/p2p/discoveryv5/transport.nim b/codexdht/private/eth/p2p/discoveryv5/transport.nim index adf5cce..d6ce8b0 100644 --- a/codexdht/private/eth/p2p/discoveryv5/transport.nim +++ b/codexdht/private/eth/p2p/discoveryv5/transport.nim @@ -235,10 +235,10 @@ proc receive*(t: Transport, a: Address, packet: openArray[byte]) = if t.client.addNode(node): trace "Added new node to routing table after handshake", node, tablesize=t.client.nodesDiscovered() - # We keep adding the node in the line above in order to not break anything. - # Then we remove the node if it using client mode. - # The operation is async because the check is done over TalkProtocol. - t.client.trackedFutures.add(t.client.removeIfClientMode(node)) + # We keep adding the node in the line above in order to not break anything. + # Then we remove the node if it using client mode. + # The operation is async because the check is done over TalkProtocol. + t.client.trackedFutures.add(t.client.removeIfClientMode(node)) discard t.sendPending(node) else: