Skip to content

Commit

Permalink
Merge pull request #101 from codex-storage/logging
Browse files Browse the repository at this point in the history
Logging updates
  • Loading branch information
cskiraly authored Oct 10, 2024
2 parents b8bcb2d + f6971cc commit 6e180af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion codexdht/private/eth/p2p/discoveryv5/protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ proc updateRecord*(
newSpr = spr.get()
seqNo = d.localNode.record.seqNum

info "Updated discovery SPR", uri = newSpr.toURI()
info "Updated discovery SPR", uri = newSpr.toURI(), newSpr = newSpr.data

d.localNode.record = newSpr
d.localNode.record.data.seqNo = seqNo
Expand Down
5 changes: 5 additions & 0 deletions codexdht/private/eth/p2p/discoveryv5/transport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6e180af

Please sign in to comment.