transport: improve logging

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

# Conflicts:
#	codexdht/private/eth/p2p/discoveryv5/transport.nim
This commit is contained in:
Csaba Kiraly 2024-10-08 11:15:20 +02:00
parent b8bcb2d08d
commit 4d9e39d86c
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,9 @@ const
responseTimeout* = 1.seconds ## timeout for the response of a request-response
## call
logScope:
topics = "discv5 transport"
type
Transport* [Client] = ref object
client: Client
@ -209,6 +212,8 @@ 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()
discard t.sendPending(node)
else:
trace "address mismatch, not adding seen flag", node, address = a, nodeAddress = node.address.get()
else:
trace "Packet decoding error", myport = t.bindAddress.port, error = decoded.error, address = a