diff options
| author | j-berman <justinberman@protonmail.com> | 2024-03-22 14:05:17 -0700 |
|---|---|---|
| committer | j-berman <justinberman@protonmail.com> | 2024-03-22 14:09:47 -0700 |
| commit | 8703b8a4cb978343e4e56eec95e8d67939611f50 (patch) | |
| tree | 471a2f3d84c60b8f062db75f8f3e3dcfb6d40824 /src | |
| parent | 81d4db08eb75ce5392c65ca6571e7b08e41b7c95 (diff) | |
| download | monzero-core-8703b8a4cb978343e4e56eec95e8d67939611f50.tar.gz monzero-core-8703b8a4cb978343e4e56eec95e8d67939611f50.tar.xz monzero-core-8703b8a4cb978343e4e56eec95e8d67939611f50.zip | |
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.cpp | 6 |
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"); |
