From 86e4f7b3f270d4acb5697ca18ff03a915d05b89b Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 5 Jul 2024 08:06:18 -0400 Subject: [PATCH] retry creating withdraw tx 5 attempts --- .../desktop/main/funds/withdrawal/WithdrawalView.java | 7 +++---- 1 file changed, 3 insertions(+), 4 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 c5e40d93..44a66881 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 @@ -99,7 +99,6 @@ public class WithdrawalView extends ActivatableView { private ChangeListener amountListener; private ChangeListener amountFocusListener; private int rowIndex = 0; - private final static int MAX_ATTEMPTS = 3; boolean sendMax = false; /////////////////////////////////////////////////////////////////////////////////////////// @@ -256,7 +255,7 @@ public class WithdrawalView extends ActivatableView { // create tx MoneroTxWallet tx = null; - for (int i = 0; i < MAX_ATTEMPTS; i++) { + for (int i = 0; i < TradeProtocol.MAX_ATTEMPTS; i++) { try { log.info("Creating withdraw tx"); long startTime = System.currentTimeMillis(); @@ -269,8 +268,8 @@ public class WithdrawalView extends ActivatableView { break; } catch (Exception e) { if (isNotEnoughMoney(e.getMessage())) throw e; - log.warn("Error creating creating withdraw tx, attempt={}/{}, error={}", i + 1, MAX_ATTEMPTS, e.getMessage()); - if (i == MAX_ATTEMPTS - 1) throw e; + log.warn("Error creating creating withdraw tx, attempt={}/{}, error={}", i + 1, TradeProtocol.MAX_ATTEMPTS, e.getMessage()); + if (i == TradeProtocol.MAX_ATTEMPTS - 1) throw e; HavenoUtils.waitFor(TradeProtocol.REPROCESS_DELAY_MS); // wait before retrying } }