From 81d54a3c893556d5aa93baef32c6d26764408aa0 Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Tue, 13 Jul 2021 09:58:45 +0200 Subject: [PATCH] Avoid trying to close discv5 transport when discv5 is not enabled (#2713) --- beacon_chain/networking/eth2_network.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index 32c0b1b4f..792e6a92c 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -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: