Stop PeerGroup only if running

This commit is contained in:
Oscar Guindzberg 2020-10-12 17:10:39 -03:00
parent 41b2e6a56d
commit 1c0655e2c7
No known key found for this signature in database
GPG key ID: 209796BF2E1D4F75

View file

@ -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);
}