|
|
@ -15,10 +15,8 @@ static const int64 nClientStartupTime = GetTime(); |
|
|
|
|
|
|
|
|
|
|
|
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : |
|
|
|
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : |
|
|
|
QObject(parent), optionsModel(optionsModel), |
|
|
|
QObject(parent), optionsModel(optionsModel), |
|
|
|
cachedNumBlocks(0), cachedNumBlocksOfPeers(0), pollTimer(0) |
|
|
|
cachedNumBlocks(0), cachedNumBlocksOfPeers(0), numBlocksAtStartup(-1), pollTimer(0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
numBlocksAtStartup = -1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pollTimer = new QTimer(this); |
|
|
|
pollTimer = new QTimer(this); |
|
|
|
pollTimer->setInterval(MODEL_UPDATE_DELAY); |
|
|
|
pollTimer->setInterval(MODEL_UPDATE_DELAY); |
|
|
|
pollTimer->start(); |
|
|
|
pollTimer->start(); |
|
|
@ -65,7 +63,8 @@ void ClientModel::updateTimer() |
|
|
|
cachedNumBlocks = newNumBlocks; |
|
|
|
cachedNumBlocks = newNumBlocks; |
|
|
|
cachedNumBlocksOfPeers = newNumBlocksOfPeers; |
|
|
|
cachedNumBlocksOfPeers = newNumBlocksOfPeers; |
|
|
|
|
|
|
|
|
|
|
|
emit numBlocksChanged(newNumBlocks, newNumBlocksOfPeers); |
|
|
|
// ensure we return the maximum of newNumBlocksOfPeers and newNumBlocks to not create weird displays in the GUI
|
|
|
|
|
|
|
|
emit numBlocksChanged(newNumBlocks, std::max(newNumBlocksOfPeers, newNumBlocks)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|