diff --git a/core/src/main/java/haveno/core/api/XmrConnectionService.java b/core/src/main/java/haveno/core/api/XmrConnectionService.java index 50307f9c..0c78fc98 100644 --- a/core/src/main/java/haveno/core/api/XmrConnectionService.java +++ b/core/src/main/java/haveno/core/api/XmrConnectionService.java @@ -99,6 +99,7 @@ public final class XmrConnectionService { private MoneroDaemonInfo lastInfo; private Long syncStartHeight = null; private TaskLooper daemonPollLooper; + @Getter private boolean isShutDownStarted; private List listeners = new ArrayList<>(); diff --git a/desktop/src/main/java/haveno/desktop/main/settings/network/NetworkSettingsView.java b/desktop/src/main/java/haveno/desktop/main/settings/network/NetworkSettingsView.java index 89c0e750..b3409371 100644 --- a/desktop/src/main/java/haveno/desktop/main/settings/network/NetworkSettingsView.java +++ b/desktop/src/main/java/haveno/desktop/main/settings/network/NetworkSettingsView.java @@ -107,7 +107,7 @@ public class NetworkSettingsView extends ActivatableView { private final ClockWatcher clockWatcher; private final WalletsSetup walletsSetup; private final P2PService p2PService; - private final XmrConnectionService connectionManager; + private final XmrConnectionService connectionService; private final ObservableList p2pNetworkListItems = FXCollections.observableArrayList(); private final SortedList p2pSortedList = new SortedList<>(p2pNetworkListItems); @@ -131,7 +131,7 @@ public class NetworkSettingsView extends ActivatableView { @Inject public NetworkSettingsView(WalletsSetup walletsSetup, P2PService p2PService, - XmrConnectionService connectionManager, + XmrConnectionService connectionService, Preferences preferences, XmrNodes xmrNodes, FilterManager filterManager, @@ -141,7 +141,7 @@ public class NetworkSettingsView extends ActivatableView { super(); this.walletsSetup = walletsSetup; this.p2PService = p2PService; - this.connectionManager = connectionManager; + this.connectionService = connectionService; this.preferences = preferences; this.xmrNodes = xmrNodes; this.filterManager = filterManager; @@ -303,10 +303,10 @@ public class NetworkSettingsView extends ActivatableView { rescanOutputsButton.setOnAction(event -> GUIUtil.rescanOutputs(preferences)); - moneroPeersSubscription = EasyBind.subscribe(connectionManager.peerConnectionsProperty(), + moneroPeersSubscription = EasyBind.subscribe(connectionService.peerConnectionsProperty(), this::updateMoneroPeersTable); - moneroBlockHeightSubscription = EasyBind.subscribe(connectionManager.chainHeightProperty(), + moneroBlockHeightSubscription = EasyBind.subscribe(connectionService.chainHeightProperty(), this::updateChainHeightTextField); nodeAddressSubscription = EasyBind.subscribe(p2PService.getNetworkNode().nodeAddressProperty(), @@ -503,6 +503,7 @@ public class NetworkSettingsView extends ActivatableView { } private void updateP2PTable() { + if (connectionService.isShutDownStarted()) return; // ignore if shutting down p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup); p2pNetworkListItems.clear(); p2pNetworkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream()