From 6a07af9e0905a917549adb8d3bbe3a065490cceb Mon Sep 17 00:00:00 2001 From: Rudolf Schmidt Date: Sat, 25 Apr 2026 03:40:59 +0200 Subject: [PATCH] simplewallet: warn when mining thread count exceeds CPU cores closes #10448 --- src/simplewallet/simplewallet.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4904059ba..6c0c6a58e 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -5383,6 +5383,12 @@ bool simple_wallet::start_mining(const std::vector& 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);