From caebd58303569aa7ab316c55539eb37258b3e107 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 20 Aug 2024 08:30:48 -0400 Subject: [PATCH] preserve withdraw fields when page reactivated while in progress --- .../desktop/main/funds/withdrawal/WithdrawalView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 0fa45624..cc5a7cd1 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 @@ -242,8 +242,12 @@ public class WithdrawalView extends ActivatableView { if (GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrWalletService)) { try { + // collect tx fields to local variables + String withdrawToAddress = withdrawToTextField.getText(); + boolean sendMax = this.sendMax; + BigInteger amount = this.amount; + // validate address - final String withdrawToAddress = withdrawToTextField.getText(); if (!MoneroUtils.isValidAddress(withdrawToAddress, XmrWalletService.getMoneroNetworkType())) { throw new IllegalArgumentException(Res.get("validation.xmr.invalidAddress")); } @@ -298,7 +302,7 @@ public class WithdrawalView extends ActivatableView { BigInteger receiverAmount = tx.getOutgoingTransfer().getDestinations().get(0).getAmount(); BigInteger fee = tx.getFee(); String messageText = Res.get("shared.sendFundsDetailsWithFee", - HavenoUtils.formatXmr(amount, true), + HavenoUtils.formatXmr(receiverAmount.add(fee), true), withdrawToAddress, HavenoUtils.formatXmr(fee, true), HavenoUtils.formatXmr(receiverAmount, true));