Fix a logical typo

This commit is contained in:
Zahary Karadjov 2020-02-05 14:47:43 +01:00 committed by zah
parent d70bb85392
commit 7e836a2c96
1 changed files with 4 additions and 1 deletions

View File

@ -258,10 +258,13 @@ proc lookup(p: Protocol, target: NodeId): Future[seq[Node]] {.async.} =
pendingQueries.add(p.lookupWorker(n, target))
inc i
debug "discv5 pending queries", total = pendingQueries.len
if pendingQueries.len == 0:
break
let idx = await oneIndex(pendingQueries)
debug "Got discv5 lookup response", idx
let nodes = pendingQueries[idx].read
pendingQueries.del(idx)
@ -337,7 +340,7 @@ proc addNode*(d: Protocol, enr: EnrUri) =
var r: Record
let res = r.fromUri(enr)
doAssert(res)
discard d.addNode newNode(r)
d.addNode newNode(r)
proc randomNodes*(k: Protocol, count: int): seq[Node] =
k.routingTable.randomNodes(count)