From 0b3763f900746c5fa9b9e0f468b52c3e15822c5f Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 18 Jul 2024 12:57:18 -0400 Subject: [PATCH] fix 'not enough money' bug by trying any subaddress --- .../src/main/java/haveno/core/xmr/wallet/XmrWalletService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java index 96ce12e5..5c53e37d 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -692,11 +692,12 @@ public class XmrWalletService { try { return createTradeTxFromSubaddress(feeAmount, feeAddress, sendAmount, sendAddress, subaddressIndices.get(i)); } catch (Exception e) { - if (i == subaddressIndices.size() - 1 && reserveExactAmount) throw e; // throw if no subaddress with exact output + log.info("Cannot create trade tx from preferred subaddress index " + subaddressIndices.get(i) + ": " + e.getMessage()); } } // try any subaddress + if (!subaddressIndices.isEmpty()) log.info("Could not create trade tx from preferred subaddresses, trying any subaddress"); return createTradeTxFromSubaddress(feeAmount, feeAddress, sendAmount, sendAddress, null); } }