From 3183f5f732945e1564889bbb94df590f192a1a36 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 5 Feb 2020 10:29:55 +0100 Subject: [PATCH 1/2] Minor code cleanups --- .../settings/network/NetworkSettingsView.java | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java index 359e6864c28..2773fe996d5 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java @@ -29,8 +29,8 @@ import bisq.desktop.util.GUIUtil; import bisq.desktop.util.validation.RegexValidator; -import bisq.core.btc.nodes.LocalBitcoinNode; import bisq.core.btc.nodes.BtcNodes; +import bisq.core.btc.nodes.LocalBitcoinNode; import bisq.core.btc.setup.WalletsSetup; import bisq.core.filter.Filter; import bisq.core.filter.FilterManager; @@ -246,9 +246,7 @@ public void initialize() { showShutDownPopup(); } }; - filterPropertyListener = (observable, oldValue, newValue) -> { - applyPreventPublicBtcNetwork(); - }; + filterPropertyListener = (observable, oldValue, newValue) -> applyPreventPublicBtcNetwork(); //TODO sorting needs other NetworkStatisticListItem as columns type /* creationDateColumn.setComparator((o1, o2) -> @@ -402,9 +400,7 @@ private void onBitcoinPeersToggleSelected(boolean calledFromUser) { if (calledFromUser) { if (isPreventPublicBtcNetwork()) { new Popup().warning(Res.get("settings.net.warn.useCustomNodes.B2XWarning")) - .onAction(() -> { - UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS); - }).show(); + .onAction(() -> UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS)).show(); } else { showShutDownPopup(); } @@ -420,18 +416,14 @@ private void onBitcoinPeersToggleSelected(boolean calledFromUser) { new Popup() .warning(Res.get("settings.net.warn.usePublicNodes")) .actionButtonText(Res.get("settings.net.warn.usePublicNodes.useProvided")) - .onAction(() -> { - UserThread.runAfter(() -> { - selectedBitcoinNodesOption = BtcNodes.BitcoinNodesOption.PROVIDED; - preferences.setBitcoinNodesOptionOrdinal(selectedBitcoinNodesOption.ordinal()); - selectBitcoinPeersToggle(); - onBitcoinPeersToggleSelected(false); - }, 300, TimeUnit.MILLISECONDS); - }) + .onAction(() -> UserThread.runAfter(() -> { + selectedBitcoinNodesOption = BtcNodes.BitcoinNodesOption.PROVIDED; + preferences.setBitcoinNodesOptionOrdinal(selectedBitcoinNodesOption.ordinal()); + selectBitcoinPeersToggle(); + onBitcoinPeersToggleSelected(false); + }, 300, TimeUnit.MILLISECONDS)) .closeButtonText(Res.get("settings.net.warn.usePublicNodes.usePublic")) - .onClose(() -> { - UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS); - }) + .onClose(() -> UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS)) .show(); } } From 161f3b85a44f4132ab49fb5ab92b087d979509cd Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 5 Feb 2020 10:31:25 +0100 Subject: [PATCH 2/2] Temporarily deactivate public network option This will be in place until we are able to check if a connected Bitcoin Core is configured properly for our requirements --- .../desktop/main/settings/network/NetworkSettingsView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java index 2773fe996d5..5b18283d9e7 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java @@ -350,8 +350,10 @@ public void deactivate() { } private boolean isPreventPublicBtcNetwork() { - return filterManager.getFilter() != null && - filterManager.getFilter().isPreventPublicBtcNetwork(); + return true; + //TODO: re-enable it if we are able to check for core nodes that have the correct configuration +// return filterManager.getFilter() != null && +// filterManager.getFilter().isPreventPublicBtcNetwork(); } private void selectBitcoinPeersToggle() {