mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-12 09:31:15 +00:00
retry creating withdraw tx 5 attempts
This commit is contained in:
parent
ec9f91e014
commit
86e4f7b3f2
1 changed files with 3 additions and 4 deletions
|
@ -99,7 +99,6 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
|
||||||
private ChangeListener<String> amountListener;
|
private ChangeListener<String> amountListener;
|
||||||
private ChangeListener<Boolean> amountFocusListener;
|
private ChangeListener<Boolean> amountFocusListener;
|
||||||
private int rowIndex = 0;
|
private int rowIndex = 0;
|
||||||
private final static int MAX_ATTEMPTS = 3;
|
|
||||||
boolean sendMax = false;
|
boolean sendMax = false;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -256,7 +255,7 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
|
||||||
|
|
||||||
// create tx
|
// create tx
|
||||||
MoneroTxWallet tx = null;
|
MoneroTxWallet tx = null;
|
||||||
for (int i = 0; i < MAX_ATTEMPTS; i++) {
|
for (int i = 0; i < TradeProtocol.MAX_ATTEMPTS; i++) {
|
||||||
try {
|
try {
|
||||||
log.info("Creating withdraw tx");
|
log.info("Creating withdraw tx");
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
|
@ -269,8 +268,8 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
|
||||||
break;
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (isNotEnoughMoney(e.getMessage())) throw e;
|
if (isNotEnoughMoney(e.getMessage())) throw e;
|
||||||
log.warn("Error creating creating withdraw tx, attempt={}/{}, error={}", i + 1, MAX_ATTEMPTS, e.getMessage());
|
log.warn("Error creating creating withdraw tx, attempt={}/{}, error={}", i + 1, TradeProtocol.MAX_ATTEMPTS, e.getMessage());
|
||||||
if (i == MAX_ATTEMPTS - 1) throw e;
|
if (i == TradeProtocol.MAX_ATTEMPTS - 1) throw e;
|
||||||
HavenoUtils.waitFor(TradeProtocol.REPROCESS_DELAY_MS); // wait before retrying
|
HavenoUtils.waitFor(TradeProtocol.REPROCESS_DELAY_MS); // wait before retrying
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue