From 2552234610675abf0dfd89327fba90ec0dfa3bec Mon Sep 17 00:00:00 2001 From: DanS Date: Wed, 1 Jul 2026 21:01:35 -0500 Subject: [PATCH] feat(mining): fetch pool hashrates + miner version at startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warm the Mining tab's data during App::init() (both off the UI thread) instead of only when the user opens the tab or clicks a mine / auto-balance button: - kick the idempotent one-shot `xmrig --version` detection, and - kick a background pool-stats refresh over the known pools. Gated on supportsPoolMining(). The pool-stats snapshot lands on a later frame and the auto-balance driver's self-throttling still applies, so this is just an earlier first fetch — hashrates + version are visible as soon as the tab opens. Full-node + lite build clean; ctest green; source hygiene clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app.cpp b/src/app.cpp index f941644..8236649 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -396,6 +396,14 @@ bool App::init() worker_->start(); network_refresh_.markDue(services::NetworkRefreshService::Timer::Price); + // Warm the Mining tab's data at startup (both async / off the UI thread) so pool + // hashrates and the installed miner version are shown as soon as the tab is opened, + // instead of only after the user clicks a mine / auto-balance button. + if (supportsPoolMining()) { + daemon::XmrigManager::startVersionDetection(); // idempotent one-shot `xmrig --version` + pool_stats_service_.refresh(util::knownPools()); // snapshot lands on a later frame + } + // Forward error/warning notifications to the console tab. The channel is the semantic // key — the Errors filter keys off ConsoleChannel::Error, and the color/accent bar are // derived from the channel at draw time.