mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-22 22:38:53 +00:00
don't limit miner threads in wallet
This commit is contained in:
parent
7ed94d3122
commit
261ee5628b
@ -3667,7 +3667,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());
|
req.miner_address = m_wallet->get_account().get_public_address_str(m_wallet->nettype());
|
||||||
|
|
||||||
bool ok = true;
|
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();
|
size_t arg_size = args.size();
|
||||||
if(arg_size >= 3)
|
if(arg_size >= 3)
|
||||||
{
|
{
|
||||||
@ -3683,7 +3682,7 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
|
|||||||
{
|
{
|
||||||
uint16_t num = 1;
|
uint16_t num = 1;
|
||||||
ok = string_tools::get_xtype_from_string(num, args[0]);
|
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;
|
req.threads_count = num;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3693,8 +3692,7 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
|
|||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
fail_msg_writer() << tr("invalid arguments. Please use start_mining [<number_of_threads>] [do_bg_mining] [ignore_battery], "
|
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;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user