Skip to content

Commit

Permalink
Fix runtime assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatfate committed Apr 25, 2024
1 parent 10ccb3c commit 80229c5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions beacon_chain/el/el_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1208,20 +1208,20 @@ proc processResponse(
status2 = status

proc lazyWait(futures: seq[FutureBase]) {.async: (raises: []).} =
doAssert len(futures) > 0
try:
block:
let pending = futures.filterIt(not(it.finished()))
await allFutures(pending).wait(30.seconds)
except CancelledError:
discard
except AsyncTimeoutError:
discard
if len(pending) > 0:
try:
await allFutures(pending).wait(30.seconds)
except CancelledError:
discard
except AsyncTimeoutError:
discard

try:
block:
let pending = futures.filterIt(not(it.finished())).mapIt(it.cancelAndWait())
await allFutures(pending)
except CancelledError:
discard
if len(pending) > 0:
await noCancel allFutures(pending)

proc sendNewPayload*(
m: ELManager,
Expand Down

0 comments on commit 80229c5

Please sign in to comment.