Browse Source

#86 - Fix progress percentage everywhere

import_zecw
Aditya Kulkarni 6 years ago
parent
commit
219430359d
  1. 7
      src/rpc.cpp

7
src/rpc.cpp

@ -582,10 +582,11 @@ void RPC::getInfoThenRefresh(bool force) {
QString txt = QString::number(blockNumber); QString txt = QString::number(blockNumber);
if (estimatedheight > 0) { if (estimatedheight > 0) {
txt = txt % " / ~" % QString::number(estimatedheight); txt = txt % " / ~" % QString::number(estimatedheight);
txt = txt % " ( " % QString::number((double)blockNumber / (double)estimatedheight * 100, 'f', 0) % "% )"; // If estimated height is available, then use the download blocks
} else { // as the progress instead of verification progress.
txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )"; progress = (double)blockNumber / (double)estimatedheight;
} }
txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )";
ui->blockheight->setText(txt); ui->blockheight->setText(txt);
ui->heightLabel->setText(QObject::tr("Downloading blocks")); ui->heightLabel->setText(QObject::tr("Downloading blocks"));
} else { } else {

Loading…
Cancel
Save