diff --git a/src/connection.cpp b/src/connection.cpp index a8aacb2..42d233b 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -39,7 +39,7 @@ void ConnectionLoader::doAutoConnect() { refreshZcashdState(connection, [=] () { // Refused connection. So try and start embedded zcashd if (Settings::getInstance()->useEmbedded()) { - this->showInformation("Starting Embedded zcashd"); + this->showInformation("Starting embedded zcashd"); if (this->startEmbeddedZcashd()) { // Embedded zcashd started up. Wait a second and then refresh the connection QTimer::singleShot(1000, [=]() { doAutoConnect(); } ); diff --git a/src/rpc.cpp b/src/rpc.cpp index 8ec889f..9fc4413 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -543,6 +543,11 @@ void RPC::getInfoThenRefresh(bool force) { bool isSyncing = progress < 0.995; // 99.59% int blockNumber = reply["blocks"].get(); + int estimatedheight = 0; + if (reply.find("estimatedheight") != reply.end()) { + estimatedheight = reply["estimatedheight"].get(); + } + Settings::getInstance()->setSyncing(isSyncing); Settings::getInstance()->setBlockNumber(blockNumber); @@ -550,11 +555,12 @@ void RPC::getInfoThenRefresh(bool force) { if (ezcashd) { if (isSyncing) { const qint64 genisisTimeMSec = 1477638000000; - qint64 estBlocks = (QDateTime::currentMSecsSinceEpoch() - genisisTimeMSec) / 2.5 / 60 / 1000; - // Round to nearest 10 - estBlocks = ((estBlocks + 5) / 10) * 10; - ui->blockheight->setText(QString::number(blockNumber) % /*" / ~" % QString::number(estBlocks) % */ - " ( " % QString::number(progress * 100, 'f', 0) % "% )"); + QString txt = QString::number(blockNumber); + if (estimatedheight > 0) { + txt = txt % " / ~" % QString::number(estimatedheight); + } + txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )"; + ui->blockheight->setText(txt); ui->heightLabel->setText("Downloading blocks"); } else { ui->blockheight->setText(QString::number(blockNumber));