Skip expected remaining sync time without estimate
See GH#1902.
This commit is contained in:
parent
44678e5442
commit
5040cd0d03
|
@ -106,7 +106,8 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
// show progress increase per hour
|
// show progress increase per hour
|
||||||
ui->progressIncreasePerH->setText(QString::number(progressPerHour > 0 ? progressPerHour*100 : 0, 'f', 2)+"%");
|
ui->progressIncreasePerH->setText(QString::number(progressPerHour > 0 ? progressPerHour*100 : 0, 'f', 2)+"%");
|
||||||
|
|
||||||
// show expected remaining time
|
// show expected remaining time, if we have a sample
|
||||||
|
if (remainingMSecs > 0)
|
||||||
ui->expectedTimeLeft->setText(GUIUtil::formatNiceTimeOffset(remainingMSecs/1000.0));
|
ui->expectedTimeLeft->setText(GUIUtil::formatNiceTimeOffset(remainingMSecs/1000.0));
|
||||||
|
|
||||||
static const int MAX_SAMPLES = 5000;
|
static const int MAX_SAMPLES = 5000;
|
||||||
|
@ -126,7 +127,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// 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 best header (happens rarely)
|
||||||
int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / Params().GetConsensus(bestHeaderHeight).nPowTargetSpacing;
|
int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / Params().GetConsensus(bestHeaderHeight).nPowTargetSpacing;
|
||||||
bool hasBestHeader = bestHeaderHeight >= count;
|
bool hasBestHeader = bestHeaderHeight >= count;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue