aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet/simplewallet.cpp
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2018-06-12 12:44:40 +0900
committerstoffu <stoffu@protonmail.ch>2018-06-13 11:56:40 +0900
commit798dfcfe7993a3e114d9917cdaa4215feaa0125a (patch)
tree30c4a112efc77e17b20687e7a37608a4b95fd7c2 /src/simplewallet/simplewallet.cpp
parentMerge pull request #3701 (diff)
downloadmonero-798dfcfe7993a3e114d9917cdaa4215feaa0125a.tar.xz
wallet: allow unspendable unmixable outputs to be discarded
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r--src/simplewallet/simplewallet.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 4020793e9..747bfe3b1 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -4816,6 +4816,20 @@ bool simple_wallet::sweep_unmixable(const std::vector<std::string> &args_)
commit_or_save(ptx_vector, m_do_not_relay);
}
}
+ catch (const tools::error::not_enough_unlocked_money& e)
+ {
+ fail_msg_writer() << tr("Not enough money in unlocked balance");
+ std::string accepted = input_line((boost::format(tr("Discarding %s of unmixable outputs that cannot be spent, which can be undone by \"rescan_spent\". Is this okay? (Y/Yes/N/No): ")) % print_money(e.available())).str());
+ if (std::cin.eof())
+ return true;
+ if (command_line::is_yes(accepted))
+ {
+ try
+ {
+ m_wallet->discard_unmixable_outputs(is_daemon_trusted());
+ } catch (...) {}
+ }
+ }
catch (const std::exception &e)
{
handle_transfer_exception(std::current_exception(), is_daemon_trusted());