From bf677ddb44b9b0c18d004c2057facb72c269128c Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Wed, 2 Jan 2019 10:26:11 -0800 Subject: [PATCH] #86 - Fix sync percentage --- src/rpc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpc.cpp b/src/rpc.cpp index 2d7a511..a799ecc 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -582,8 +582,10 @@ void RPC::getInfoThenRefresh(bool force) { QString txt = QString::number(blockNumber); if (estimatedheight > 0) { txt = txt % " / ~" % QString::number(estimatedheight); + txt = txt % " ( " % QString::number((double)blockNumber / (double)estimatedheight * 100, 'f', 0) % "% )"; + } else { + txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )"; } - txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )"; ui->blockheight->setText(txt); ui->heightLabel->setText(QObject::tr("Downloading blocks")); } else {