From: gg Date: Sun, 18 Jan 2026 22:00:54 +0000 (-0500) Subject: wip status tooltip X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=ae55524b52cc904c5d95824f8977f87e465017c2;p=gamesguru%2Ffeather.git wip status tooltip --- diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index f0f0258b..6db6671d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -884,37 +884,23 @@ void MainWindow::updateStatusToolTip() { void MainWindow::updateSyncStatusToolTip() { if (!m_wallet) return; - quint64 walletHeight = m_wallet->blockChainHeight(); - quint64 targetHeight = m_wallet->daemonBlockChainTargetHeight(); + bool isPaused = conf()->get(Config::syncPaused).toBool(); - // 1. Calculate real lag (if connected) - quint64 blocksBehind = 0; - if (targetHeight > walletHeight) { - blocksBehind = targetHeight - walletHeight; - } + quint64 walletHeight = m_wallet->blockChainHeight(); + quint64 daemonHeight = m_wallet->daemonBlockChainHeight(); + quint64 blocksBehind = daemonHeigh - walletHeight; - // 2. Calculate estimate lag (if paused or offline) - // Only use time-estimation if we don't have a live connection - bool isPaused = conf()->get(Config::syncPaused).toBool(); + // Use time-estimation if we don't have a live connection if (isPaused || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) { - // Only estimate if we deviate from the cached target, OR if target is unknown - if (targetHeight == 0 || targetHeight > walletHeight) { QDateTime lastSync = m_wallet->lastSyncTime(); if (lastSync.isValid()) { qint64 secs = lastSync.secsTo(QDateTime::currentDateTime()); if (secs > 0) blocksBehind = secs / 120; // 120s per block - } } } - // 3. Build status tooltip - QString tooltip = tr("Wallet Height: %1").arg(QLocale().toString(walletHeight)); - - // Only show Network Tip if we are actually connected - if (!isPaused && m_wallet->connectionStatus() == Wallet::ConnectionStatus_Synchronized) { - if (targetHeight > 0) - tooltip += tr(" | Network Tip: %1").arg(QLocale().toString(targetHeight)); - } + // Build tooltip + QString tooltip = tr("Daemon Height: %1").arg(QLocale().toString(daemonHeight)); if (conf()->get(Config::lastNetInfoUpdate).toULongLong() > 0) { tooltip += tr("\nLast network update: %1").arg(