From 5f5d7279b67ed045a45c997281913f7f7ea27a03 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 18 Sep 2016 10:44:32 +0100 Subject: [PATCH] wallet: fix empty tx in corner case sending nothing --- src/wallet/wallet2.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index f080f1e0..02f8ae53 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3279,6 +3279,9 @@ std::vector wallet2::create_transactions_2(std::vector(); + // start with an empty tx txes.push_back(TX()); accumulated_fee = 0; @@ -3515,6 +3518,9 @@ std::vector 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(); + // start with an empty tx txes.push_back(TX()); accumulated_fee = 0;