mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-22 04:24:05 +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
|
||||
# TRACE level, if a timeout is reached).
|
||||
let
|
||||
waitedFutures = @[
|
||||
node.discovery.closeWait(),
|
||||
node.switch.stop(),
|
||||
]
|
||||
waitedFutures = if node.discoveryEnabled:
|
||||
@[node.discovery.closeWait(), node.switch.stop()]
|
||||
else:
|
||||
@[node.switch.stop()]
|
||||
timeout = 5.seconds
|
||||
completed = await withTimeout(allFutures(waitedFutures), timeout)
|
||||
if not completed:
|
||||
|
Loading…
x
Reference in New Issue
Block a user