diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-01-31 15:21:45 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-01-31 15:21:45 +0200 |
commit | 569316aea30d089380c8553ca67095c13f13dd52 (patch) | |
tree | c058a5d29284ea07fe26dad2b917640cf74790af /src/wallet/wallet2.cpp | |
parent | Merge pull request #633 (diff) | |
parent | wallet: forbid dust altogether in output selection where appropriate (diff) | |
download | monero-569316aea30d089380c8553ca67095c13f13dd52.tar.xz |
Merge pull request #634
7fc6fa3 wallet: forbid dust altogether in output selection where appropriate (moneromooo-monero)
5e1a739 blockchain: log number of outputs available for a new tx (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index cf90d1aca..49e090904 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1587,7 +1587,7 @@ namespace // returns: // direct return: amount of money found // modified reference: selected_transfers, a list of iterators/indices of input sources -uint64_t wallet2::select_transfers(uint64_t needed_money, bool add_dust, uint64_t dust, std::list<transfer_container::iterator>& selected_transfers) +uint64_t wallet2::select_transfers(uint64_t needed_money, bool add_dust, uint64_t dust, bool hf2_rules, std::list<transfer_container::iterator>& selected_transfers) { std::vector<size_t> unused_transfers_indices; std::vector<size_t> unused_dust_indices; @@ -1602,7 +1602,15 @@ uint64_t wallet2::select_transfers(uint64_t needed_money, bool add_dust, uint64_ if (dust < td.amount() && is_valid_decomposed_amount(td.amount())) unused_transfers_indices.push_back(i); else - unused_dust_indices.push_back(i); + { + // for hf2 rules, we disregard dust, which will be spendable only + // via sweep_dust. If we're asked to add dust, though, we still + // consider them, as this will be a mixin 0 tx (and thus we may + // end up with a tx with one mixable output and N dusty ones). + // This should be made better at some point... + if (!hf2_rules || add_dust) + unused_dust_indices.push_back(i); + } } } |