mirror of
https://github.com/wownero/wownero.git
synced 2026-10-19 00:18:53 +02:00
Merge pull request #10460
6a07af9 simplewallet: warn when mining thread count exceeds CPU cores (Rudolf Schmidt)
This commit is contained in:
@@ -5383,6 +5383,12 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args)
|
||||
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;
|
||||
bool r = m_wallet->invoke_http_json("/start_mining", req, res);
|
||||
std::string err = interpret_rpc_response(r, res.status);
|
||||
|
||||
Reference in New Issue
Block a user