diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-28 15:07:15 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-28 15:07:15 +0000 |
commit | 2bf029be172a47ace8134143e1320fdb10d3ea44 (patch) | |
tree | d614dfda2c484f68cfd74f3ba3b82e53930b68da /src | |
parent | Merge pull request #1618 (diff) | |
download | monero-2bf029be172a47ace8134143e1320fdb10d3ea44.tar.xz |
wallet2: fix corner case failing to send a second output
If a rct transaction can be made with just one input, a second
output will be added. This output will be the smallest amount
output available. However, if this output is a non rct output
with less available fake outs than requested, the transaction
will be rejected. We now check the histogram to only consider
outputs with enough available fake outs in the first place.
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet2.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 4348b8a62..cc12f275c 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4119,7 +4119,8 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp THROW_WALLET_EXCEPTION_IF(needed_money == 0, error::zero_destination); // gather all our dust and non dust outputs - for (size_t i = 0; i < m_transfers.size(); ++i) + const std::vector<size_t> unused_indices = select_available_outputs_from_histogram(fake_outs_count + 1, true, true, trusted_daemon); + for (size_t i: unused_indices) { const transfer_details& td = m_transfers[i]; if (!td.m_spent && (use_rct ? true : !td.is_rct()) && is_transfer_unlocked(td)) |