diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-01-25 16:57:03 -0800 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-01-25 16:57:03 -0800 |
commit | 09d19c9139918524c5b08aa8dc39cf9985f3d999 (patch) | |
tree | 8fe57d2e350e8562d325d7184877702547aa1d78 | |
parent | Merge pull request #3084 (diff) | |
parent | simplewallet: single out 0 amount destinations as dummy ones (diff) | |
download | monero-09d19c9139918524c5b08aa8dc39cf9985f3d999.tar.xz |
Merge pull request #3130
5ae617d5 simplewallet: single out 0 amount destinations as dummy ones (moneromooo-monero)
c1d19f3c wallet2: fix sweep_all sending an atomic unit (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 16 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 2ab714aff..b6b6da441 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -4677,12 +4677,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"); diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 117b2fdab..0c2b7e984 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -7126,7 +7126,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton THROW_WALLET_EXCEPTION_IF(needed_fee > available_for_fee, error::wallet_internal_error, "Transaction cannot pay for itself"); - while (needed_fee > test_ptx.fee) { + do { LOG_PRINT_L2("We made a tx, adjusting fee and saving it"); tx.dsts[0].amount = available_for_fee - needed_fee; if (use_rct) @@ -7139,7 +7139,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton needed_fee = calculate_fee(fee_per_kb, txBlob, fee_multiplier); LOG_PRINT_L2("Made an attempt at a final " << get_size_string(txBlob) << " tx, with " << print_money(test_ptx.fee) << " fee and " << print_money(test_ptx.change_dts.amount) << " change"); - } + } while (needed_fee > test_ptx.fee); LOG_PRINT_L2("Made a final " << get_size_string(txBlob) << " tx, with " << print_money(test_ptx.fee) << " fee and " << print_money(test_ptx.change_dts.amount) << " change"); |