From 9dcf3b7eea3f4e5467f858de66c8e3b5793b7282 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 11 Mar 2022 12:54:09 +0200 Subject: [PATCH] final fix for send to paynym max button issue --- .../com/sparrowwallet/sparrow/wallet/PaymentController.java | 2 +- .../com/sparrowwallet/sparrow/wallet/SendController.java | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java index 66f7022d..d365857b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java @@ -328,7 +328,7 @@ public class PaymentController extends WalletFormController implements Initializ WalletNode sendNode = recipientBip47Wallet.getFreshNode(KeyPurpose.SEND); ECKey pubKey = sendNode.getPubKey(); Address address = recipientBip47Wallet.getScriptType().getAddress(pubKey); - if(sendController.getPaymentTabs().getTabs().size() > 1 || (getRecipientValueSats() != null && getRecipientValueSats() > getRecipientDustThreshold(address))) { + if(sendController.getPaymentTabs().getTabs().size() > 1 || (getRecipientValueSats() != null && getRecipientValueSats() > getRecipientDustThreshold(address)) || maxButton.isSelected()) { return address; } } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index 932527eb..d42ea0ed 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -392,15 +392,11 @@ public class SendController extends WalletFormController implements Initializabl setFeeRate(feeRate); setEffectiveFeeRate(walletTransaction); - - if(walletTransaction.getPayments().stream().anyMatch(Payment::isSendMax)) { - updateOptimizationButtons(getPayments()); - } } transactionDiagram.update(walletTransaction); updatePrivacyAnalysis(walletTransaction); - createButton.setDisable(walletTransaction == null || isInsufficientFeeRate() || isPayNymMixOnlyPayment(getPayments())); + createButton.setDisable(walletTransaction == null || isInsufficientFeeRate() || isPayNymMixOnlyPayment(walletTransaction.getPayments())); }); transactionDiagram.sceneProperty().addListener((observable, oldScene, newScene) -> {