]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
no background sync when paused; allow autoReconnect() on non-onion nodes
authorgg <chown_tee@proton.me>
Tue, 13 Jan 2026 00:00:20 +0000 (19:00 -0500)
committergg <chown_tee@proton.me>
Tue, 13 Jan 2026 00:00:20 +0000 (19:00 -0500)
src/MainWindow.cpp
src/libwalletqt/Wallet.cpp
src/utils/nodes.cpp

index e09378940f1069399d597a7fb476258789c6ccab..590bef339fe3f972aca707b9d82abbd050bf43c3 100644 (file)
@@ -863,7 +863,6 @@ void MainWindow::setPausedSyncStatus() {
     QString tooltip;
     QString status = Utils::getPausedSyncStatus(m_wallet, m_nodes, &tooltip);
 
-    // Log variables for debugging 149 vs 814k discrepancy
     if (m_wallet) {
         qDebug() << "Paused Status Calc: WalletHeight:" << m_wallet->blockChainHeight()
                  << "DaemonHeight:" << m_wallet->daemonBlockChainHeight()
@@ -876,10 +875,6 @@ void MainWindow::setPausedSyncStatus() {
 }
 
 void MainWindow::setStatusText(const QString &text, bool override, int timeout) {
-    // Log to qWarning as requested for debugging
-    if (text != m_statusText) {
-        qTrace() << "Setting status text:" << text;
-    }
 
     if (override) {
         m_statusOverrideActive = true;
@@ -1541,7 +1536,6 @@ void MainWindow::changeEvent(QEvent* event)
     if (event->type() == QEvent::WindowStateChange) {
         qDebug() << "changeEvent: WindowStateChange. State:" << this->windowState() << " isMinimized:" << this->isMinimized();
         if (this->isMinimized()) {
-             // ... existing logic ...
             if (conf()->get(Config::lockOnMinimize).toBool()) {
                 this->lockWallet();
             }
@@ -1569,6 +1563,7 @@ void MainWindow::changeEvent(QEvent* event)
                 bool minimizeToTray = conf()->get(Config::minimizeToTray).toBool();
                 if (showTray && minimizeToTray) {
                     // Hide all widgets and dialogs, not just MainWindow
+                    // TODO: Implement better logic here
                     for (const auto &widget : QApplication::topLevelWidgets()) {
                         widget->hide();
                     }
index cf1dbc127d2b847d6f1232dd78e630d59064ab63..485c3e22b120f8a72268716ad8a9aa4697da4828 100644 (file)
@@ -511,6 +511,12 @@ void Wallet::startRefreshThread()
                     // Don't call refresh function if we don't have the daemon and target height
                     // We do this to prevent to UI from getting confused about the amount of blocks that are still remaining
                     if (haveHeights) {
+                        // Prevent background network usage when sync is paused
+                        if (m_syncPaused) {
+                           last = std::chrono::steady_clock::now();
+                           continue;
+                        }
+
                         QMutexLocker locker(&m_asyncMutex);
 
                         if (m_newWallet) {
index d9702f2dae00a21b3a8e9943b155f6a9b8357ec1..bd95bbcc6bf121699dcc6bbf607cbc3f5c95200d 100644 (file)
@@ -424,7 +424,11 @@ void Nodes::onWalletRefreshed() {
         if (m_connection.isOnion())
             return;
 
-        this->autoConnect(true);
+        // If want onion node but aren't connected to one, reconnect used to blindly fire.
+        // We should check if we actually intend to switch.
+        if (this->useOnionNodes()) {
+            this->autoConnect(true);
+        }
     }
 }