wallet_rpc_server: use start mining response
What changed, and why it matters
This is a tiny code cleanup in Monero's wallet RPC server. The code was accidentally reusing the wrong response variable when checking whether background mining started successfully. The fix makes it use the correct response variable, so error messages and status checks are accurate. There is no security vulnerability here—just a bug fix that prevents misleading log output.
No security action needed. Treat as a normal code-quality fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In wallet_rpc_server.cpp, the background mining setup path called invoke_http_json(“/start_mining”, req2, res) but then checked res2.status and logged res.status. The patch changes the call to store into res2 and the error log to read res2.status, making the variable usage consistent. This is a straightforward correctness fix with no apparent security implications.
Changed components
src/wallet/wallet_rpc_server.cppInspect captured patch +2 / −2
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 8239aa0..881e1ef 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -488,10 +488,10 @@ namespace tools
req2.threads_count = 1;
req2.do_background_mining = true;
req2.ignore_battery = false;
- r = m_wallet->invoke_http_json("/start_mining", req2, res);
+ r = m_wallet->invoke_http_json("/start_mining", req2, res2);
if (!r || res2.status != CORE_RPC_STATUS_OK)
{
- MERROR("Failed to setup background mining: " << (r ? res.status : "No connection to daemon"));
+ MERROR("Failed to setup background mining: " << (r ? res2.status : "No connection to daemon"));
return;
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.