wallet_rpc_server: refresh immediately when auto_refresh is enabled
What changed, and why it matters
This is a small user-experience fix for the Monero wallet's auto-refresh feature. When a user turns on auto-refresh, the wallet will now refresh on the next idle tick instead of waiting a full period first. There is no security bug being fixed here based on the commit content.
No security action required. Treat as normal functional improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies wallet_rpc_server.cpp’s auto-refresh enable handler. After computing the new refresh period, if auto-refresh is enabled, it sets m_last_auto_refresh_time to (now - new_period), which causes the next idle-loop refresh check to fire immediately rather than after waiting the full period. This is a timing/behavior tweak, not a security patch.
Changed components
src/wallet/wallet_rpc_server.cppInspect captured patch +3 / −0
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 517ceec..149d58e 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -3427,6 +3427,9 @@ namespace tools
{
const auto new_period = req.enable ? req.period ? req.period : DEFAULT_AUTO_REFRESH_PERIOD : 0;
m_auto_refresh_period.store(new_period, std::memory_order_relaxed);
+ // refresh on the next idle tick rather than after a full period
+ if (new_period)
+ m_last_auto_refresh_time = std::chrono::steady_clock::now() - std::chrono::seconds(new_period);
MINFO("Auto refresh now " << (new_period ? std::to_string(new_period) + " seconds" : std::string("disabled")));
return true;
}
Why this scored 18/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.