aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2013-01-05 07:45:02 -0800
committerWladimir J. van der Laan <[email protected]>2013-01-05 07:45:02 -0800
commiteb5c24c4645ba69bc7a053b09e19825cdc5c9168 (patch)
treed8738b283c418822bd0a9662596181e96345ffd2 /src/qt/clientmodel.cpp
parentMerge pull request #1685 from Diapolo/Qt_add_options_reset (diff)
parentBitcoin-Qt: never display own block count > estimated block count (diff)
downloaddiscoin-eb5c24c4645ba69bc7a053b09e19825cdc5c9168.tar.xz
discoin-eb5c24c4645ba69bc7a053b09e19825cdc5c9168.zip
Merge pull request #2148 from Diapolo/est_block_count
Bitcoin-Qt: never display own block count > estimated block count
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index ce112803f..12bd98933 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -15,10 +15,8 @@ static const int64 nClientStartupTime = GetTime();
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
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->setInterval(MODEL_UPDATE_DELAY);
pollTimer->start();
@@ -65,7 +63,8 @@ void ClientModel::updateTimer()
cachedNumBlocks = newNumBlocks;
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));
}
}