diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-01-15 18:47:11 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-01-16 15:41:25 +0000 |
commit | 5ae617d5aee6a102ac6a7a061f0266c21f95a5dd (patch) | |
tree | c759a4e797aa7949e301fa9852a8115876611ca2 /src/simplewallet/simplewallet.cpp | |
parent | wallet2: fix sweep_all sending an atomic unit (diff) | |
download | monero-5ae617d5aee6a102ac6a7a061f0266c21f95a5dd.tar.xz |
simplewallet: single out 0 amount destinations as dummy ones
Avoids surprising the user with "sending 0 to..."
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index b9a3e45b4..a4d6f0c2d 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -4669,12 +4669,24 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes, payment_id_string = "no payment ID"; std::string dest_string; + size_t n_dummy_outputs = 0; for (auto i = dests.begin(); i != dests.end(); ) { - dest_string += (boost::format(tr("sending %s to %s")) % print_money(i->second.second) % i->second.first).str(); + if (i->second.second > 0) + { + if (!dest_string.empty()) + dest_string += ", "; + dest_string += (boost::format(tr("sending %s to %s")) % print_money(i->second.second) % i->second.first).str(); + } + else + ++n_dummy_outputs; ++i; - if (i != dests.end()) + } + if (n_dummy_outputs > 0) + { + if (!dest_string.empty()) dest_string += ", "; + dest_string += std::to_string(n_dummy_outputs) + tr(" dummy output(s)"); } if (dest_string.empty()) dest_string = tr("with no destinations"); |