|
|
@ -7,6 +7,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "guiutil.h" |
|
|
|
#include "guiutil.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "chainparams.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <QResizeEvent> |
|
|
|
#include <QResizeEvent> |
|
|
|
#include <QPropertyAnimation> |
|
|
|
#include <QPropertyAnimation> |
|
|
|
|
|
|
|
|
|
|
@ -125,11 +127,11 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri |
|
|
|
|
|
|
|
|
|
|
|
// estimate the number of headers left based on nPowTargetSpacing
|
|
|
|
// estimate the number of headers left based on nPowTargetSpacing
|
|
|
|
// and check if the gui is not aware of the the best header (happens rarely)
|
|
|
|
// and check if the gui is not aware of the the best header (happens rarely)
|
|
|
|
int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / 600; |
|
|
|
int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / Params().GetConsensus().nPowTargetSpacing; |
|
|
|
bool hasBestHeader = bestHeaderHeight >= count; |
|
|
|
bool hasBestHeader = bestHeaderHeight >= count; |
|
|
|
|
|
|
|
|
|
|
|
// show remaining number of blocks
|
|
|
|
// show remaining number of blocks
|
|
|
|
if (estimateNumHeadersLeft < 24 && hasBestHeader) { |
|
|
|
if (estimateNumHeadersLeft < HEADER_HEIGHT_DELTA_SYNC && hasBestHeader) { |
|
|
|
ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count)); |
|
|
|
ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight)); |
|
|
|
ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight)); |
|
|
|