Add TODO comments from review

This commit is contained in:
kdeme 2020-03-01 11:50:26 +01:00
parent b951ec45dc
commit 86bceaa5d8
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
2 changed files with 3 additions and 0 deletions

View File

@ -363,6 +363,8 @@ proc revalidateLoop(p: Protocol) {.async.} =
await sleepAsync(rand(10 * 1000).milliseconds) await sleepAsync(rand(10 * 1000).milliseconds)
let n = p.routingTable.nodeToRevalidate() let n = p.routingTable.nodeToRevalidate()
if not n.isNil: if not n.isNil:
# TODO: Should we do these in parallel and/or async to be certain of how
# often nodes are revalidated?
await p.revalidateNode(n) await p.revalidateNode(n)
except CancelledError: except CancelledError:
trace "revalidateLoop canceled" trace "revalidateLoop canceled"

View File

@ -239,6 +239,7 @@ proc randomNodes*(r: RoutingTable, count: int): seq[Node] =
# insignificant compared to the time it takes for the network roundtrips when connecting # insignificant compared to the time it takes for the network roundtrips when connecting
# to nodes. # to nodes.
while len(seen) < count: while len(seen) < count:
# TODO: Is it important to get a better random source for these sample calls?
let bucket = sample(r.buckets) let bucket = sample(r.buckets)
if bucket.nodes.len != 0: if bucket.nodes.len != 0:
let node = sample(bucket.nodes) let node = sample(bucket.nodes)