mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-02 01:36:06 +00:00
Avoid trying to close discv5 transport when discv5 is not enabled (#2713)
This commit is contained in:
parent
6b07b79427
commit
81d54a3c89
@ -1236,10 +1236,10 @@ proc stop*(node: Eth2Node) {.async.} =
|
|||||||
# Ignore errors in futures, since we're shutting down (but log them on the
|
# Ignore errors in futures, since we're shutting down (but log them on the
|
||||||
# TRACE level, if a timeout is reached).
|
# TRACE level, if a timeout is reached).
|
||||||
let
|
let
|
||||||
waitedFutures = @[
|
waitedFutures = if node.discoveryEnabled:
|
||||||
node.discovery.closeWait(),
|
@[node.discovery.closeWait(), node.switch.stop()]
|
||||||
node.switch.stop(),
|
else:
|
||||||
]
|
@[node.switch.stop()]
|
||||||
timeout = 5.seconds
|
timeout = 5.seconds
|
||||||
completed = await withTimeout(allFutures(waitedFutures), timeout)
|
completed = await withTimeout(allFutures(waitedFutures), timeout)
|
||||||
if not completed:
|
if not completed:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user