aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet/simplewallet.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-04-26 18:04:00 +0200
committerRiccardo Spagni <ric@spagni.net>2016-04-26 18:04:00 +0200
commit7098ad68043d2491eb82ee986b6fcec2ea4d4f3a (patch)
treef5e5dd96a3a61c76108e7d93ec39bf6f21240056 /src/simplewallet/simplewallet.cpp
parentMerge pull request #813 (diff)
parent modified: src/wallet/wallet2.cpp (diff)
downloadmonero-7098ad68043d2491eb82ee986b6fcec2ea4d4f3a.tar.xz
Merge pull request #814
68cbe15 modified: src/wallet/wallet2.cpp modified: src/wallet/wallet2.h (awfulcrawler) 4b325bd modified: src/simplewallet/simplewallet.cpp modified: src/wallet/wallet2.cpp modified: src/wallet/wallet2.h (awfulcrawler)
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r--src/simplewallet/simplewallet.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index f6e5f2cc6..43dad75f2 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -2231,24 +2231,36 @@ bool simple_wallet::transfer_main(bool new_algorithm, const std::vector<std::str
if (m_wallet->always_confirm_transfers() || ptx_vector.size() > 1)
{
uint64_t total_fee = 0;
+ uint64_t dust_not_in_fee = 0;
+ uint64_t dust_in_fee = 0;
for (size_t n = 0; n < ptx_vector.size(); ++n)
{
total_fee += ptx_vector[n].fee;
+
+ if (ptx_vector[n].dust_added_to_fee)
+ dust_in_fee += ptx_vector[n].dust;
+ else
+ dust_not_in_fee += ptx_vector[n].dust;
}
- std::string prompt_str;
+ std::stringstream prompt;
if (ptx_vector.size() > 1)
{
- prompt_str = (boost::format(tr("Your transaction needs to be split into %llu transactions. "
- "This will result in a transaction fee being applied to each transaction, for a total fee of %s. Is this okay? (Y/Yes/N/No)")) %
- ((unsigned long long)ptx_vector.size()) % print_money(total_fee)).str();
+ prompt << boost::format(tr("Your transaction needs to be split into %llu transactions. "
+ "This will result in a transaction fee being applied to each transaction, for a total fee of %s")) %
+ ((unsigned long long)ptx_vector.size()) % print_money(total_fee);
}
else
{
- prompt_str = (boost::format(tr("The transaction fee is %s. Is this okay? (Y/Yes/N/No)")) %
- print_money(total_fee)).str();
+ prompt << boost::format(tr("The transaction fee is %s")) %
+ print_money(total_fee);
}
- std::string accepted = command_line::input_line(prompt_str);
+ if (dust_in_fee != 0) prompt << boost::format(tr(", of which %s is dust from change")) % print_money(dust_in_fee);
+ if (dust_not_in_fee != 0) prompt << tr(".") << ENDL << boost::format(tr("A total of %s from dust change will be sent to dust address"))
+ % print_money(dust_not_in_fee);
+ prompt << tr(".") << ENDL << tr("Is this okay? (Y/Yes/N/No)");
+
+ std::string accepted = command_line::input_line(prompt.str());
if (std::cin.eof())
return true;
if (accepted != "Y" && accepted != "y" && accepted != "Yes" && accepted != "yes")