mirror of https://github.com/status-im/nim-eth.git
Add TODO comments from review
This commit is contained in:
parent
b951ec45dc
commit
86bceaa5d8
|
@ -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"
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue