Changeset View
Changeset View
Standalone View
Standalone View
src/qt/modaloverlay.cpp
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | ui->percentageProgress->setText( | ||||
QString::number(nVerificationProgress * 100, 'f', 2) + "%"); | QString::number(nVerificationProgress * 100, 'f', 2) + "%"); | ||||
ui->progressBar->setValue(nVerificationProgress * 100); | ui->progressBar->setValue(nVerificationProgress * 100); | ||||
if (!bestHeaderDate.isValid()) | if (!bestHeaderDate.isValid()) | ||||
// not syncing | // not syncing | ||||
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) / | int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / | ||||
Params().GetConsensus().nPowTargetSpacing; | Params().GetConsensus().nPowTargetSpacing; | ||||
bool hasBestHeader = bestHeaderHeight >= count; | bool hasBestHeader = bestHeaderHeight >= count; | ||||
// show remaining number of blocks | // show remaining number of blocks | ||||
if (estimateNumHeadersLeft < HEADER_HEIGHT_DELTA_SYNC && hasBestHeader) { | if (estimateNumHeadersLeft < HEADER_HEIGHT_DELTA_SYNC && hasBestHeader) { | ||||
ui->numberOfBlocksLeft->setText( | ui->numberOfBlocksLeft->setText( | ||||
QString::number(bestHeaderHeight - count)); | QString::number(bestHeaderHeight - count)); | ||||
Show All 34 Lines |