mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-05-22 09:39:44 +00:00
Fix client mode checking
This commit is contained in:
parent
c24955c442
commit
07b9e0427e
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user