From a302380e1e15b870eb8ad659022fc85d1ace4952 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Sat, 19 Feb 2022 22:15:13 -0600 Subject: [PATCH] Improve BSQ swap error messaging. Re-enable popup warning indicating when DAO needs to be resynced. --- core/src/main/java/bisq/core/trade/TradeManager.java | 3 ++- core/src/main/resources/i18n/displayStrings.properties | 9 +++++++++ .../offer/bsq_swap/take_offer/BsqSwapTakeOfferView.java | 4 ++-- .../bisq/desktop/main/presentation/DaoPresentation.java | 5 ++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/TradeManager.java b/core/src/main/java/bisq/core/trade/TradeManager.java index 22586f991d1..acfef2fb262 100644 --- a/core/src/main/java/bisq/core/trade/TradeManager.java +++ b/core/src/main/java/bisq/core/trade/TradeManager.java @@ -364,7 +364,8 @@ private void handleBsqSwapRequest(NodeAddress peer, BsqSwapRequest request) { peer, errorMessage -> { if (takeOfferRequestErrorMessageHandler != null) - takeOfferRequestErrorMessageHandler.handleErrorMessage(errorMessage); + takeOfferRequestErrorMessageHandler.handleErrorMessage( + errorMessage + Res.get("notification.bsqSwap.errorHelp")); }); requestPersistence(); diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 92d44a99e70..c14ded62885 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -3164,6 +3164,15 @@ notification.bsqSwap.maker.headline=BSQ swap completed notification.bsqSwap.maker.tradeCompleted=Your offer with ID ''{0}'' has been taken. notification.bsqSwap.confirmed.headline=BSQ swap transaction confirmed notification.bsqSwap.confirmed.text=The BSQ swap transaction for trade with ID ''{0}'' is confirmed. +notification.bsqSwap.errorHelp=\n\n\ + Trade failures with BSQ swaps are rare, in cases like this it is worthwhile checking if:\n\ + ● your DAO state is synced without error.\n\ + ● your SPV wallet is functioning well.\n\n\ + DAO state can be checked by navigating to DAO -> Network Monitor -> DAO State. It can be resynced by \ + pressing the button "Rebuild DAO State From Resources" under Settings -> Preferences.\n\n\ + SPV status is harder to determine, usually a resync is necessary whenever you experience problems transacting \ + on the blockchain. More info at [HYPERLINK:https://bisq.wiki/Resyncing_SPV_file] + #################################################################### # System Tray diff --git a/desktop/src/main/java/bisq/desktop/main/offer/bsq_swap/take_offer/BsqSwapTakeOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/bsq_swap/take_offer/BsqSwapTakeOfferView.java index 60024d11012..a60856f7cd4 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/bsq_swap/take_offer/BsqSwapTakeOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/bsq_swap/take_offer/BsqSwapTakeOfferView.java @@ -378,8 +378,8 @@ protected void addSubscriptions() { if (newValue == null) { return; } - new Popup().error(Res.get("takeOffer.error.message", model.errorMessage.get()) + "\n\n" + - Res.get("popup.error.tryRestart")) + new Popup().warning(Res.get("takeOffer.error.message", model.errorMessage.get()) + + Res.get("notification.bsqSwap.errorHelp")) .onClose(() -> { model.resetErrorMessage(); model.dataModel.removeOffer(); diff --git a/desktop/src/main/java/bisq/desktop/main/presentation/DaoPresentation.java b/desktop/src/main/java/bisq/desktop/main/presentation/DaoPresentation.java index 1ff32e07e19..d36efe3faa6 100644 --- a/desktop/src/main/java/bisq/desktop/main/presentation/DaoPresentation.java +++ b/desktop/src/main/java/bisq/desktop/main/presentation/DaoPresentation.java @@ -1,6 +1,7 @@ package bisq.desktop.main.presentation; import bisq.desktop.Navigation; +import bisq.desktop.util.GUIUtil; import bisq.core.btc.wallet.BsqWalletService; import bisq.core.btc.wallet.BtcWalletService; @@ -98,9 +99,7 @@ private void onUpdateAnyChainHeight() { bsqInfo.set(""); if (daoFacade.isInConflictWithSeedNode() && !daoConflictWarningShown) { daoConflictWarningShown = true; // only warn max 1 time per session so as not to annoy - // TODO: only temporarily removed for v1.8.2 to prevent showing false positives and will be - // re-enabled with the next release -// GUIUtil.showDaoNeedsResyncPopup(navigation); + GUIUtil.showDaoNeedsResyncPopup(navigation); } } else { bsqInfo.set(Res.get("mainView.footer.bsqInfo.synchronizing"));