Skip to content

Commit

Permalink
Merge pull request #1097
Browse files Browse the repository at this point in the history
5f5d727 wallet: fix empty tx in corner case sending nothing (moneromooo-monero)
  • Loading branch information
fluffypony committed Sep 18, 2016
2 parents 8522010 + 5f5d727 commit a6914c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a6914c1

Please sign in to comment.