diff options
Diffstat (limited to 'src/qt/modaloverlay.cpp')
-rw-r--r-- | src/qt/modaloverlay.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp index 686014da1a..efdd494d9f 100644 --- a/src/qt/modaloverlay.cpp +++ b/src/qt/modaloverlay.cpp @@ -75,6 +75,7 @@ void ModalOverlay::setKnownBestHeight(int count, const QDateTime& blockDate) if (count > bestHeaderHeight) { bestHeaderHeight = count; bestHeaderDate = blockDate; + UpdateHeaderSyncLabel(); } } @@ -140,11 +141,16 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri if (estimateNumHeadersLeft < HEADER_HEIGHT_DELTA_SYNC && hasBestHeader) { ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count)); } else { - ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight)); + UpdateHeaderSyncLabel(); ui->expectedTimeLeft->setText(tr("Unknown...")); } } +void ModalOverlay::UpdateHeaderSyncLabel() { + int est_headers_left = bestHeaderDate.secsTo(QDateTime::currentDateTime()) / Params().GetConsensus().nPowTargetSpacing; + ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1, %2%)...").arg(bestHeaderHeight).arg(QString::number(100.0 / (bestHeaderHeight + est_headers_left) * bestHeaderHeight, 'f', 1))); +} + void ModalOverlay::toggleVisibility() { showHide(layerIsVisible, true); |