From 5b50a553b490e5a182c3480d8db7c54794c6d6fd Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 10 Aug 2023 11:46:12 -0400 Subject: [PATCH] allow withraw without p2p connection --- .../desktop/main/funds/withdrawal/WithdrawalView.java | 2 +- .../portfolio/pendingtrades/PendingTradesDataModel.java | 2 +- desktop/src/main/java/haveno/desktop/util/GUIUtil.java | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java b/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java index ce58884d..961310b8 100644 --- a/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java +++ b/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java @@ -165,7 +165,7 @@ public class WithdrawalView extends ActivatableView { /////////////////////////////////////////////////////////////////////////////////////////// private void onWithdraw() { - if (GUIUtil.isReadyForTxBroadcastOrShowPopup(p2PService, xmrWalletService.getConnectionsService())) { + if (GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrWalletService.getConnectionsService())) { try { // get withdraw address diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java index 798e3ffd..b82ea8a6 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java @@ -548,7 +548,7 @@ public class PendingTradesDataModel extends ActivatableDataModel { } public boolean isReadyForTxBroadcast() { - return GUIUtil.isReadyForTxBroadcastOrShowPopup(p2PService, connectionService); + return GUIUtil.isBootstrappedOrShowPopup(p2PService) && GUIUtil.isReadyForTxBroadcastOrShowPopup(connectionService); } public boolean isBootstrappedOrShowPopup() { diff --git a/desktop/src/main/java/haveno/desktop/util/GUIUtil.java b/desktop/src/main/java/haveno/desktop/util/GUIUtil.java index f4440eec..d2c40e61 100644 --- a/desktop/src/main/java/haveno/desktop/util/GUIUtil.java +++ b/desktop/src/main/java/haveno/desktop/util/GUIUtil.java @@ -689,11 +689,7 @@ public class GUIUtil { return false; } - public static boolean isReadyForTxBroadcastOrShowPopup(P2PService p2PService, CoreMoneroConnectionsService connectionService) { - if (!GUIUtil.isBootstrappedOrShowPopup(p2PService)) { - return false; - } - + public static boolean isReadyForTxBroadcastOrShowPopup(CoreMoneroConnectionsService connectionService) { if (!connectionService.hasSufficientPeersForBroadcast()) { new Popup().information(Res.get("popup.warning.notSufficientConnectionsToBtcNetwork", connectionService.getMinBroadcastConnections())).show(); return false;