Remove no longer needed try/except (#339)

This commit is contained in:
Kim De Mey 2021-03-26 17:49:03 +01:00 committed by GitHub
parent ac8aa0e037
commit ae4177851f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 23 deletions

View File

@ -213,7 +213,6 @@ proc updateRecord*(
proc send(d: Protocol, a: Address, data: seq[byte]) =
let ta = initTAddress(a.ip, a.port)
try:
let f = d.transp.sendTo(ta, data)
f.callback = proc(data: pointer) {.gcsafe.} =
if f.failed:
@ -228,12 +227,6 @@ proc send(d: Protocol, a: Address, data: seq[byte]) =
# nodes. Else the revalidation might end up clearing the routing tabl
# because of ping failures due to own network connection failure.
warn "Discovery send failed", msg = f.readError.msg
except Exception as e:
# TODO: General exception still being raised from Chronos, but in practice
# all CatchableErrors should be grabbed by the above `f.failed`.
if e of Defect:
raise (ref Defect)(e)
else: doAssert(false)
proc send(d: Protocol, n: Node, data: seq[byte]) =
doAssert(n.address.isSome())
@ -835,7 +828,6 @@ proc revalidateNode*(d: Protocol, n: Node) {.async.} =
proc revalidateLoop(d: Protocol) {.async.} =
## Loop which revalidates the nodes in the routing table by sending the ping
## message.
# TODO: General Exception raised.
try:
while true:
await sleepAsync(milliseconds(d.rng[].rand(revalidateMax)))
@ -849,7 +841,6 @@ proc refreshLoop(d: Protocol) {.async.} =
## Loop that refreshes the routing table by starting a random query in case
## no queries were done since `refreshInterval` or more.
## It also refreshes the majority address voted for via pong responses.
# TODO: General Exception raised.
try:
await d.populateTable()