diff --git a/libp2pdht/private/eth/p2p/discoveryv5/node.nim b/libp2pdht/private/eth/p2p/discoveryv5/node.nim index cf61e47..4e7a854 100644 --- a/libp2pdht/private/eth/p2p/discoveryv5/node.nim +++ b/libp2pdht/private/eth/p2p/discoveryv5/node.nim @@ -28,7 +28,8 @@ type address*: Option[Address] record*: SignedPeerRecord seen*: bool ## Indicates if there was at least one successful - ## request-response with this node. + ## request-response with this node, or if the nde was verified + ## through the underlying transport mechanisms. func toNodeId*(pk: keys.PublicKey): NodeId = ## Convert public key to a node identifier. diff --git a/libp2pdht/private/eth/p2p/discoveryv5/transport.nim b/libp2pdht/private/eth/p2p/discoveryv5/transport.nim index c49770c..adff276 100644 --- a/libp2pdht/private/eth/p2p/discoveryv5/transport.nim +++ b/libp2pdht/private/eth/p2p/discoveryv5/transport.nim @@ -144,6 +144,9 @@ proc receive*(t: Transport, a: Address, packet: openArray[byte]) = # on the next revalidation, one could spam these as the handshake # message occurs on (first) incoming messages. if node.address.isSome() and a == node.address.get(): + # TODO: maybe here we could verify that the address matches what we were + # sending the 'whoareyou' message to. In that case, we can set 'seen' + node.seen = true if t.client.addNode(node): trace "Added new node to routing table after handshake", node else: