Skip to content

Commit

Permalink
fix 'not enough money' bug by trying any subaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jul 18, 2024
1 parent 7308206 commit e7f0397
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,12 @@ private MoneroTxWallet createTradeTx(BigInteger feeAmount, String feeAddress, Bi
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);
}
}
Expand Down

0 comments on commit e7f0397

Please sign in to comment.