aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-10-15 17:31:14 +0200
committerRiccardo Spagni <ric@spagni.net>2017-10-15 17:31:14 +0200
commit62629541a53f9a4b9d9562d8dd1b3ca5628bde9d (patch)
tree62693be6c4c68302e1b3b076dfdfd7a26f24a68f /src/simplewallet
parentMerge pull request #2549 (diff)
parentsimplewallet: allow 1/yes/y as well as true for start_mining options (diff)
downloadmonero-62629541a53f9a4b9d9562d8dd1b3ca5628bde9d.tar.xz
Merge pull request #2550
735fafec simplewallet: allow 1/yes/y as well as true for start_mining options (moneromooo-monero)
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 990922743..882f1f72a 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -792,7 +792,7 @@ simple_wallet::simple_wallet()
, m_in_manual_refresh(false)
, m_current_subaddress_account(0)
{
- m_cmd_binder.set_handler("start_mining", boost::bind(&simple_wallet::start_mining, this, _1), tr("start_mining [<number_of_threads>] - Start mining in daemon"));
+ m_cmd_binder.set_handler("start_mining", boost::bind(&simple_wallet::start_mining, this, _1), tr("start_mining [<number_of_threads>] [bg_mining] [ignore_battery] - Start mining in daemon (bg_mining and ignore_battery are optional booleans)"));
m_cmd_binder.set_handler("stop_mining", boost::bind(&simple_wallet::stop_mining, this, _1), tr("Stop mining in daemon"));
m_cmd_binder.set_handler("save_bc", boost::bind(&simple_wallet::save_bc, this, _1), tr("Save current blockchain data"));
m_cmd_binder.set_handler("refresh", boost::bind(&simple_wallet::refresh, this, _1), tr("Synchronize transactions and balance"));
@@ -1871,8 +1871,8 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
bool ok = true;
size_t max_mining_threads_count = (std::max)(tools::get_max_concurrency(), static_cast<unsigned>(2));
size_t arg_size = args.size();
- if(arg_size >= 3) req.ignore_battery = args[2] == "true";
- if(arg_size >= 2) req.do_background_mining = args[1] == "true";
+ if(arg_size >= 3) req.ignore_battery = is_it_true(args[2]);
+ if(arg_size >= 2) req.do_background_mining = is_it_true(args[1]);
if(arg_size >= 1)
{
uint16_t num = 1;