aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeon Klingele <git@leonklingele.de>2017-11-03 04:49:26 +0100
committerLeon Klingele <git@leonklingele.de>2017-11-03 04:52:26 +0100
commit424852a627bfbf922edb93b4a5d5297b65086c2d (patch)
tree4f08bedc15df9cbedc3b127b2bdece38b7f23185 /src
parentMerge pull request #2666 (diff)
downloadmonero-424852a627bfbf922edb93b4a5d5297b65086c2d.tar.xz
Fix 'sweep_all' command when called with no args
Executing 'sweep_all' with no arguments segfaulted before.
Diffstat (limited to 'src')
-rw-r--r--src/simplewallet/simplewallet.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index b55b39236..2f7204159 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -3068,6 +3068,12 @@ bool simple_wallet::sweep_unmixable(const std::vector<std::string> &args_)
bool simple_wallet::sweep_main(uint64_t below, const std::vector<std::string> &args_)
{
// sweep_all [index=<N1>[,<N2>,...]] [<ring_size>] <address> [<payment_id>]
+ if (args_.size() == 0)
+ {
+ fail_msg_writer() << tr("No address given");
+ return true;
+ }
+
if (m_wallet->ask_password() && !get_and_verify_password()) { return true; }
if (!try_connect_to_daemon())
return true;
@@ -3135,12 +3141,6 @@ bool simple_wallet::sweep_main(uint64_t below, const std::vector<std::string> &a
local_args.pop_back();
}
- if (local_args.size() == 0)
- {
- fail_msg_writer() << tr("No address given");
- return true;
- }
-
cryptonote::address_parse_info info;
if (!cryptonote::get_account_address_from_str_or_url(info, m_wallet->testnet(), local_args[0], oa_prompter))
{