Skip to content
Permalink
Browse files

Don't limit miner threads in wallet

  • Loading branch information...
miltonf committed Apr 8, 2019
1 parent 7999dda commit 4a255c9afe3a0e3ae7366f1f4c3d5c4c722dca3b
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/simplewallet/simplewallet.cpp
@@ -3696,7 +3696,6 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
req.miner_address = m_wallet->get_account().get_public_address_str(m_wallet->nettype());

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)
{
@@ -3712,7 +3711,7 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
{
uint16_t num = 1;
ok = string_tools::get_xtype_from_string(num, args[0]);
ok = ok && (1 <= num && num <= max_mining_threads_count);
ok = ok && 1 <= num;
req.threads_count = num;
}
else
@@ -3722,8 +3721,7 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)

if (!ok)
{
fail_msg_writer() << tr("invalid arguments. Please use start_mining [<number_of_threads>] [do_bg_mining] [ignore_battery], "
"<number_of_threads> should be from 1 to ") << max_mining_threads_count;
fail_msg_writer() << tr("invalid arguments. Please use start_mining [<number_of_threads>] [do_bg_mining] [ignore_battery]");
return true;
}

0 comments on commit 4a255c9

Please sign in to comment.
You can’t perform that action at this time.