diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-09-18 10:44:32 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-09-18 10:44:32 +0100 |
commit | 5f5d7279b67ed045a45c997281913f7f7ea27a03 (patch) | |
tree | f031f63a3def73c3ce3693ccb766f16366b9976e /src/wallet | |
parent | Merge pull request #1084 (diff) | |
download | monero-5f5d7279b67ed045a45c997281913f7f7ea27a03.tar.xz |
wallet: fix empty tx in corner case sending nothing
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet2.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index f080f1e0d..02f8ae535 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3279,6 +3279,9 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp } LOG_PRINT_L2("Starting with " << unused_transfers_indices.size() << " non-dust outputs and " << unused_dust_indices.size() << " dust outputs"); + if (unused_dust_indices.empty() && unused_transfers_indices.empty()) + return std::vector<wallet2::pending_tx>(); + // start with an empty tx txes.push_back(TX()); accumulated_fee = 0; @@ -3515,6 +3518,9 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_all(const cryptono } LOG_PRINT_L2("Starting with " << unused_transfers_indices.size() << " non-dust outputs and " << unused_dust_indices.size() << " dust outputs"); + if (unused_dust_indices.empty() && unused_transfers_indices.empty()) + return std::vector<wallet2::pending_tx>(); + // start with an empty tx txes.push_back(TX()); accumulated_fee = 0; |