Skip to content

Commit

Permalink
Merge pull request #3938 from ripcurlx/temporarily-deactivate-public-…
Browse files Browse the repository at this point in the history
…network

Temporarily deactivate public network option
  • Loading branch information
sqrrm authored Feb 5, 2020
2 parents 6a9f340 + 161f3b8 commit 3748a7e
Showing 1 changed file with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) ->
Expand Down Expand Up @@ -352,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() {
Expand Down Expand Up @@ -402,9 +402,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();
}
Expand All @@ -420,18 +418,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();
}
}
Expand Down

0 comments on commit 3748a7e

Please sign in to comment.