From 9f82bba26059110dd2661b4e316614e3506bccc2 Mon Sep 17 00:00:00 2001 From: DanS Date: Wed, 10 Jun 2026 15:21:44 -0500 Subject: [PATCH] perf(node): skip the mining-info poll during sync too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sync throttle (kSyncProfile) covers the core/transactions/addresses/peers timers, but getmininginfo runs off the separate 1s Fast timer and so still polled ~every 5s during sync — another cs_main contender slowing block connection. Skip it while syncing unless the user is on the Mining tab or actively mining (where live stats are wanted). Completes the "no RPC contention during sync beyond the 10s progress poll" goal. Co-Authored-By: Claude Opus 4.8 --- src/app_network.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app_network.cpp b/src/app_network.cpp index 95e88bd..e97ba9d 100644 --- a/src/app_network.cpp +++ b/src/app_network.cpp @@ -1473,6 +1473,12 @@ void App::refreshMiningInfo() bool doSlowRefresh = (mining_slow_counter_++ % 5 == 0); bool includeLocalHashrate = state_.mining.generate || current_page_ == ui::NavPage::Mining; if (!includeLocalHashrate && !doSlowRefresh) return; + + // While syncing, don't poll getmininginfo (another cs_main contender) unless the user is + // actually on the Mining tab or mining — mining stats are irrelevant mid-sync, and this keeps + // the sync throttle complete (the mining poll runs off the separate 1s Fast timer, so the + // sync-profile intervals don't otherwise cover it). + if (state_.sync.syncing && !includeLocalHashrate) return; ui::NavPage tracePage = current_page_; auto enqueued = network_refresh_.enqueue(services::NetworkRefreshService::Job::Mining, *w,