]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
move syncPause checks to top of refresh thread loop
authorgg <chown_tee@proton.me>
Sun, 18 Jan 2026 21:28:39 +0000 (16:28 -0500)
committergg <chown_tee@proton.me>
Sun, 18 Jan 2026 21:28:57 +0000 (16:28 -0500)
src/libwalletqt/Wallet.cpp

index a6fef448f647ecf4dd21d77e6ad960ef442046fd..525d539c5fe4f15fc634c3f8dcd43702f9753497 100644 (file)
@@ -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::microseconds>(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;
-                    }
                 }
             }