From: gg Date: Tue, 13 Jan 2026 00:00:20 +0000 (-0500) Subject: no background sync when paused; allow autoReconnect() on non-onion nodes X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=43a440be70f37c0f8d0b57594fe503ffee127058;p=gamesguru%2Ffeather.git no background sync when paused; allow autoReconnect() on non-onion nodes --- diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e0937894..590bef33 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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(); } diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index cf1dbc12..485c3e22 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -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) { diff --git a/src/utils/nodes.cpp b/src/utils/nodes.cpp index d9702f2d..bd95bbcc 100644 --- a/src/utils/nodes.cpp +++ b/src/utils/nodes.cpp @@ -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); + } } }