diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index d6106e5559e..e544a75ca6b 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2891,6 +2891,9 @@ popup.warning.btcChangeBelowDustException=This transaction creates a change outp You need to add the dust amount to your sending amount to avoid to generate a dust output.\n\n\ The dust output is {0}. +popup.warning.whileSynchronizingNoBsqFundsForBtcFeePayment=Your BSQ wallet is disabled while DAO is synchronizing \ + and your BSQ balance may appear to be zero during this period. Please check the status bar and try again later when \ + Synchronizing DAO is complete, or continue now with this trade and use BTC to pay the trade fees. popup.warning.insufficientBsqFundsForBtcFeePayment=You''ll need more BSQ to do this transaction—the last \ 5.46 BSQ in your wallet cannot be used to pay trade fees because of dust limits in the Bitcoin protocol.\n\n\ You can either buy more BSQ or pay trade fees with BTC.\n\n\ diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index f0f42d5e5d1..c7fbe94a87c 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -323,7 +323,7 @@ public void initWithData(OfferPayload.Direction direction, TradeCurrency tradeCu updatePriceToggle(); if (!model.getDataModel().isMakerFeeValid() && model.getDataModel().getMakerFee() != null) - showInsufficientBsqFundsForBtcFeePaymentPopup(); + showNoBsqFundsAvailableForBtcFeePaymentPopup(); } // called form parent as the view does not get notified when the tab is closed @@ -356,19 +356,20 @@ private void onPlaceOffer() { }); } } else { - showInsufficientBsqFundsForBtcFeePaymentPopup(); + howNoBsqFundsAvailableForBtcFeePaymentPopup(); } } } - private void showInsufficientBsqFundsForBtcFeePaymentPopup() { + private void showNoBsqFundsAvailableForBtcFeePaymentPopup() { Coin makerFee = model.getDataModel().getMakerFee(false); String message = null; - if (makerFee != null) { + if ((daoFacade.getChainHeight() != bsqWalletService.getBestChainHeight()) || (bsqWalletService.getBestChainHeight() == 0)) + message = Res.get("popup.warning.whileSynchronizingNoBsqFundsForBtcFeePayment"); + else if (makerFee != null) message = Res.get("popup.warning.insufficientBsqFundsForBtcFeePayment", bsqFormatter.formatCoinWithCode(makerFee.subtract(model.getDataModel().getUsableBsqBalance()))); - - } else if (model.getDataModel().getUsableBsqBalance().isZero()) + else if (model.getDataModel().getUsableBsqBalance().isZero()) message = Res.get("popup.warning.noBsqFundsForBtcFeePayment"); if (message != null) @@ -1132,13 +1133,13 @@ private void showFeeOption() { if (!isPreferredFeeCurrencyBtc && !isBsqForFeeAvailable) { Coin makerFee = model.getDataModel().getMakerFee(false); String missingBsq = null; - if (makerFee != null) { + if ((daoFacade.getChainHeight() != bsqWalletService.getBestChainHeight()) || (bsqWalletService.getBestChainHeight() == 0)) + message = Res.get("popup.warning.whileSynchronizingNoBsqFundsForBtcFeePayment"); + else if (makerFee != null) missingBsq = Res.get("popup.warning.insufficientBsqFundsForBtcFeePayment", bsqFormatter.formatCoinWithCode(makerFee.subtract(model.getDataModel().getUsableBsqBalance()))); - - } else if (model.getDataModel().getUsableBsqBalance().isZero()) { + else if (model.getDataModel().getUsableBsqBalance().isZero()) missingBsq = Res.get("popup.warning.noBsqFundsForBtcFeePayment"); - } if (missingBsq != null) { new Popup().warning(missingBsq) diff --git a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java index caeab48c27c..dd76b782ea8 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java @@ -430,7 +430,7 @@ private void onTakeOffer() { } if (!model.dataModel.isTakerFeeValid()) { - showInsufficientBsqFundsForBtcFeePaymentPopup(); + showNoBsqFundsAvailabeForBtcFeePaymentPopup(); return; } @@ -939,13 +939,13 @@ private void showFeeOption() { if (!isPreferredFeeCurrencyBtc && !isBsqForFeeAvailable) { Coin takerFee = model.dataModel.getTakerFee(false); String missingBsq = null; - if (takerFee != null) { + if ((daoFacade.getChainHeight() != bsqWalletService.getBestChainHeight()) || (bsqWalletService.getBestChainHeight() == 0)) + message = Res.get("popup.warning.whileSynchronizingNoBsqFundsForBtcFeePayment"); + else if (takerFee != null) missingBsq = Res.get("popup.warning.insufficientBsqFundsForBtcFeePayment", bsqFormatter.formatCoinWithCode(takerFee.subtract(model.dataModel.getUsableBsqBalance()))); - - } else if (model.dataModel.getUsableBsqBalance().isZero()) { + else if (model.dataModel.getUsableBsqBalance().isZero()) missingBsq = Res.get("popup.warning.noBsqFundsForBtcFeePayment"); - } if (missingBsq != null) { new Popup().warning(missingBsq) @@ -1234,13 +1234,14 @@ private VBox getTradeFeeFieldsBox() { /////////////////////////////////////////////////////////////////////////////////////////// - private void showInsufficientBsqFundsForBtcFeePaymentPopup() { + private void showNoBsqFundsAvailabeForBtcFeePaymentPopup() { Coin takerFee = model.dataModel.getTakerFee(false); String message = null; - if (takerFee != null) + if ((daoFacade.getChainHeight() != bsqWalletService.getBestChainHeight()) || (bsqWalletService.getBestChainHeight() == 0)){ + message = Res.get("popup.warning.whileSynchronizingNoBsqFundsForBtcFeePayment"); + else if (takerFee != null) { message = Res.get("popup.warning.insufficientBsqFundsForBtcFeePayment", bsqFormatter.formatCoinWithCode(takerFee.subtract(model.dataModel.getUsableBsqBalance()))); - else if (model.dataModel.getUsableBsqBalance().isZero()) message = Res.get("popup.warning.noBsqFundsForBtcFeePayment"); @@ -1357,4 +1358,3 @@ private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, S infoGridPane.getChildren().addAll(label, textField); } } -