aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-05-05 11:22:46 +0200
committerRiccardo Spagni <ric@spagni.net>2017-05-05 11:22:46 +0200
commit5566951ebae942e61f91ab4e5f4020b2fe4f920e (patch)
tree640b13e0e4615e485ae7f3faaf374ed8157fa61b /src/wallet/wallet2.cpp
parent9a9fb0483f8a233ec506bb0ad8c60466b9977807 (diff)
parent6df83b3efb31337ba832697783f6c6940b4fec6b (diff)
downloadmonzero-core-5566951ebae942e61f91ab4e5f4020b2fe4f920e.tar.gz
monzero-core-5566951ebae942e61f91ab4e5f4020b2fe4f920e.tar.xz
monzero-core-5566951ebae942e61f91ab4e5f4020b2fe4f920e.zip
Merge pull request #1986
6df83b3e wallet: add sweep_below function (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 4adec0719..9069789ca 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -4581,7 +4581,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
return ptx_vector;
}
-std::vector<wallet2::pending_tx> wallet2::create_transactions_all(const cryptonote::account_public_address &address, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t> extra, bool trusted_daemon)
+std::vector<wallet2::pending_tx> wallet2::create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t> extra, bool trusted_daemon)
{
std::vector<size_t> unused_transfers_indices;
std::vector<size_t> unused_dust_indices;
@@ -4593,10 +4593,13 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_all(const cryptono
const transfer_details& td = m_transfers[i];
if (!td.m_spent && (use_rct ? true : !td.is_rct()) && is_transfer_unlocked(td))
{
- if (td.is_rct() || is_valid_decomposed_amount(td.amount()))
- unused_transfers_indices.push_back(i);
- else
- unused_dust_indices.push_back(i);
+ if (below == 0 || td.amount() < below)
+ {
+ if (td.is_rct() || is_valid_decomposed_amount(td.amount()))
+ unused_transfers_indices.push_back(i);
+ else
+ unused_dust_indices.push_back(i);
+ }
}
}