diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-03-26 11:51:58 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-03-26 11:51:58 +0000 |
commit | f9a2fd2ff55654cdbc458378d0365189ffd1c46a (patch) | |
tree | 24a28612bac268c47719d41a8f3850ab8bb71f0e /src | |
parent | wallet: factor fee calculation (diff) | |
download | monero-f9a2fd2ff55654cdbc458378d0365189ffd1c46a.tar.xz |
wallet: handle rare case where fee adjustment can bump to the next kB
It resulted in a tx being sent with too low a fee, and thus rejected.
Diffstat (limited to '')
-rw-r--r-- | src/wallet/wallet2.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 7c54ca5e9..aa638143c 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2677,7 +2677,7 @@ std::vector<wallet2::pending_tx> wallet2::create_dust_sweep_transactions() // loop until fee is met without increasing tx size to next KB boundary. uint64_t needed_fee = 0; - if (1) + do { transfer_dust(num_outputs_per_tx, (uint64_t)0 /* unlock_time */, 0, detail::digit_split_strategy, dust_policy, extra, tx, ptx); auto txBlob = t_serializable_object_to_blob(ptx.tx); @@ -2687,7 +2687,8 @@ std::vector<wallet2::pending_tx> wallet2::create_dust_sweep_transactions() // if there's not enough for the fee, it'll throw transfer_dust(num_outputs_per_tx, (uint64_t)0 /* unlock_time */, needed_fee, detail::digit_split_strategy, dust_policy, extra, tx, ptx); txBlob = t_serializable_object_to_blob(ptx.tx); - } + needed_fee = calculate_fee(txBlob); + } while (ptx.fee < needed_fee); ptx_vector.push_back(ptx); |