aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2024-05-20 23:33:31 -0500
committerluigi1111 <luigi1111w@gmail.com>2024-05-20 23:33:31 -0500
commitb85f32073853f8009970e1b80bb3fa357b18c6d8 (patch)
tree14db31ffc2173018c841997fb435e4678cd154d2
parent026be65bf5e68d95a02379ef2d7bacdb2685e6bf (diff)
parent8703b8a4cb978343e4e56eec95e8d67939611f50 (diff)
downloadmonzero-core-b85f32073853f8009970e1b80bb3fa357b18c6d8.tar.gz
monzero-core-b85f32073853f8009970e1b80bb3fa357b18c6d8.tar.xz
monzero-core-b85f32073853f8009970e1b80bb3fa357b18c6d8.zip
Merge pull request #9260
8703b8a wallet2: ensure transfers and sweeps use same fee calc logic rnd2 (j-berman)
-rw-r--r--src/wallet/wallet2.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index f34b10988..6ae31b8bb 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -11119,8 +11119,8 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
else
{
LOG_PRINT_L2("We made a tx, adjusting fee and saving it, we need " << print_money(needed_fee) << " and we have " << print_money(test_ptx.fee));
- size_t fee_tries;
- for (fee_tries = 0; fee_tries < 10 && needed_fee > test_ptx.fee; ++fee_tries) {
+ size_t fee_tries = 0;
+ do {
tx_dsts = tx.get_adjusted_dsts(needed_fee);
if (use_rct)
@@ -11133,7 +11133,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
needed_fee = calculate_fee(use_per_byte_fee, test_ptx.tx, txBlob.size(), base_fee, fee_quantization_mask);
LOG_PRINT_L2("Made an attempt at a final " << get_weight_string(test_ptx.tx, txBlob.size()) << " tx, with " << print_money(test_ptx.fee) <<
" fee and " << print_money(test_ptx.change_dts.amount) << " change");
- };
+ } while (needed_fee > test_ptx.fee && ++fee_tries < 10);
THROW_WALLET_EXCEPTION_IF(fee_tries == 10, error::wallet_internal_error,
"Too many attempts to raise pending tx fee to level of needed fee");