From 1c0655e2c7c28428a0068cfe953ad3744a62dc10 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Mon, 12 Oct 2020 17:10:39 -0300 Subject: [PATCH] Stop PeerGroup only if running --- core/src/main/java/bisq/core/btc/setup/WalletConfig.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java index fc8c6a0950..9f57403642 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java @@ -468,9 +468,13 @@ public class WalletConfig extends AbstractIdleService { // vPeerGroup.stop has no timeout and can take very long (10 sec. in my test). So we call it at the end. // We might get likely interrupted by the parent call timeout. - vPeerGroup.stop(); + if (vPeerGroup.isRunning()) { + vPeerGroup.stop(); + log.info("PeerGroup stopped"); + } else { + log.info("PeerGroup not stopped because it was not running"); + } vPeerGroup = null; - log.info("PeerGroup stopped"); } catch (BlockStoreException e) { throw new IOException(e); }