From 78b3bf56f7804f3eb1b7cf8b189c5d567be7ca60 Mon Sep 17 00:00:00 2001 From: Janne Pulkkinen Date: Sat, 10 Sep 2011 12:43:45 +0300 Subject: The synchronization progress bar now compares the amount of total blocks to amount of blocks downloaded at application start-up. Could be probably implemented better. --- src/qt/clientmodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/qt/clientmodel.cpp') diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index d30747310..08abaa6b4 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -18,6 +18,8 @@ ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(update())); timer->start(MODEL_UPDATE_DELAY); + + numBlocksAtStartup = -1; } int ClientModel::getNumConnections() const @@ -30,6 +32,12 @@ int ClientModel::getNumBlocks() const return nBestHeight; } +int ClientModel::getNumBlocksAtStartup() +{ + if (numBlocksAtStartup == -1) numBlocksAtStartup = getNumBlocks(); + return numBlocksAtStartup; +} + QDateTime ClientModel::getLastBlockDate() const { return QDateTime::fromTime_t(pindexBest->GetBlockTime()); -- cgit v1.2.3