From f99a21476d834081403cd97947c12ce44b892438 Mon Sep 17 00:00:00 2001 From: gg Date: Sun, 18 Jan 2026 16:28:39 -0500 Subject: [PATCH] move syncPause checks to top of refresh thread loop --- src/libwalletqt/Wallet.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index a6fef448..525d539c 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -528,6 +528,17 @@ void Wallet::startRefreshThread() continue; } + // Scan mempool if paused, low-bandwidth query if user has enabled it + if (m_syncPaused) { + if (m_refreshNow || conf()->get(Config::scanMempoolWhenPaused).toBool()) { + qDebug() << "[SYNC PAUSED] Scanning mempool because scans are enabled"; + scanMempool(); + m_refreshNow = false; + } + last = std::chrono::steady_clock::now(); + continue; + } + m_refreshNow = false; auto loopStartTime = std::chrono::time_point_cast(std::chrono::steady_clock::now()); // get daemonHeight and targetHeight @@ -574,19 +585,6 @@ void Wallet::startRefreshThread() quint64 walletHeight = m_walletImpl->blockChainHeight(); m_walletImpl->refresh(); } - - // Scan mempool if paused - // Low-bandwidth query if user has enabled it - if (m_syncPaused) { - if (m_refreshNow || conf()->get(Config::scanMempoolWhenPaused).toBool()) { - scanMempool(); - m_refreshNow = false; - } else { - std::this_thread::sleep_for(std::chrono::milliseconds(250)); - } - last = std::chrono::steady_clock::now(); - continue; - } } } -- 2.52.0