aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorj-berman <justinberman@protonmail.com>2024-03-22 14:05:17 -0700
committerj-berman <justinberman@protonmail.com>2024-03-22 14:05:17 -0700
commit427ba7702fb8c4047662f0c8edcdd7e529b9ff28 (patch)
tree2f1a3b5f91b674686db0e690e7f98a163e09b9ce /src
parentMerge pull request #9243 (diff)
downloadmonero-427ba7702fb8c4047662f0c8edcdd7e529b9ff28.tar.xz
wallet2: ensure transfers and sweeps use same fee calc logic rnd2
Looks like the logic from #8882 was accidentally removed in #8861 (regressing to the behavior noted in the #8882 description). This commit brings that logic back.
Diffstat (limited to 'src')
-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 a9ad67f04..5c749d33e 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -10422,8 +10422,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)
@@ -10436,7 +10436,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");