From: gg Date: Sun, 18 Jan 2026 22:49:27 +0000 (-0500) Subject: duplicate code? X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=fbfbfb9fee0bc85e2468bf6828603cdf7c5f8fd0;p=gamesguru%2Ffeather.git duplicate code? --- 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)) {