From fbfbfb9fee0bc85e2468bf6828603cdf7c5f8fd0 Mon Sep 17 00:00:00 2001 From: gg Date: Sun, 18 Jan 2026 17:49:27 -0500 Subject: [PATCH] duplicate code? --- src/MainWindow.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index f0db0ff4..496a51bb 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -884,6 +884,13 @@ void MainWindow::updateStatusToolTip() { void MainWindow::updateSyncStatusToolTip() { if (!m_wallet) return; + // Throttle updates to 1s to prevent overwhelming the event loop (e.g. m_updateBytes timer) + static QDateTime lastUpdate = QDateTime::currentDateTime(); + if (lastUpdate.msecsTo(QDateTime::currentDateTime()) < 1000) { + return; + } + lastUpdate = QDateTime::currentDateTime(); + bool isPaused = conf()->get(Config::syncPaused).toBool(); quint64 walletHeight = m_wallet->blockChainHeight(); @@ -1975,14 +1982,6 @@ void MainWindow::updateNetStats() { bool showTraffic = trafficCooldown > 0; - // Update tooltip - QString tooltip = ""; - if (m_lastNetInfoUpdate.isValid()) { - qint64 secs = m_lastNetInfoUpdate.secsTo(QDateTime::currentDateTime()); - tooltip = tr("Last updated net info: %1 seconds ago").arg(secs); - } - m_statusLabelStatus->setToolTip(tooltip); - if (!m_wallet || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected || (m_wallet->connectionStatus() == Wallet::ConnectionStatus_Synchronized && !m_coinsRefreshing && !showTraffic)) { -- 2.52.0