mirror of
https://github.com/wownero/wownero.git
synced 2026-11-19 15:13:56 +01:00
simplewallet: warn when mining thread count exceeds CPU cores
closes #10448
This commit is contained in:
@@ -5383,6 +5383,12 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const unsigned int hw_concurrency = boost::thread::hardware_concurrency();
|
||||||
|
if (hw_concurrency && req.threads_count > hw_concurrency)
|
||||||
|
{
|
||||||
|
message_writer(console_color_yellow, false) << boost::format(tr("Warning: %u mining threads requested exceeds the %u hardware threads available on this CPU. Consider using %u for best performance.")) % req.threads_count % hw_concurrency % hw_concurrency;
|
||||||
|
}
|
||||||
|
|
||||||
COMMAND_RPC_START_MINING::response res;
|
COMMAND_RPC_START_MINING::response res;
|
||||||
bool r = m_wallet->invoke_http_json("/start_mining", req, res);
|
bool r = m_wallet->invoke_http_json("/start_mining", req, res);
|
||||||
std::string err = interpret_rpc_response(r, res.status);
|
std::string err = interpret_rpc_response(r, res.status);
|
||||||
|
|||||||
Reference in New Issue
Block a user