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.

This commit is contained in:
Janne Pulkkinen
2011-09-10 12:43:45 +03:00
committed by Wladimir J. van der Laan
parent 9b9e2f1748
commit 78b3bf56f7
3 changed files with 14 additions and 2 deletions

View File

@@ -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());