Move remove code from shutDown to onP2pNetworkAndWalletReady

This commit is contained in:
chimp1984 2020-09-04 13:59:35 -05:00
parent 75c85f3d85
commit 6162e6d0d7
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -148,10 +148,6 @@ public class XmrTxProofService implements AssetTxProofService {
@Override
public void shutDown() {
if (p2pNetworkAndWalletReady != null) {
p2pNetworkAndWalletReady.removeListener(p2pNetworkAndWalletReadyListener);
}
servicesByTradeId.values().forEach(XmrTxProofRequestsPerTrade::terminate);
servicesByTradeId.clear();
}
@ -162,6 +158,12 @@ public class XmrTxProofService implements AssetTxProofService {
///////////////////////////////////////////////////////////////////////////////////////////
private void onP2pNetworkAndWalletReady() {
if (p2pNetworkAndWalletReady != null) {
p2pNetworkAndWalletReady.removeListener(p2pNetworkAndWalletReadyListener);
p2pNetworkAndWalletReady = null;
p2pNetworkAndWalletReadyListener = null;
}
if (!preferences.findAutoConfirmSettings("XMR").isPresent()) {
log.error("AutoConfirmSettings is not present");
}