aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-01-03 22:13:24 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-01-04 17:21:40 +0100
commit54413aab135aa84f60bfcb477a4d2ecfb72edbac (patch)
tree9388d6c4413a5fdc747af84be8b787af66aa0b16 /src/qt/clientmodel.cpp
parentea9788517bfa3e53e192c5af9e64e73625f9db74 (diff)
Bitcoin-Qt: never display own block count > estimated block count
- some users reported it as weird, that the estimated block count could be lower than our own nodes block number (which is indeed true and not good) - this pull adds a new default behaviour, which displays our own block number as estimated block number, if own >= est. block count - the pull raises space for nodes block counts in cPeerBlockCounts to 8 to be more accurate - also removes a reduntant setNumBlocks() call in RPCConsole and moves initialisation of numBlocksAtStartup in ClientModel, where it belongs
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 ce112803f8..12bd989338 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));
}
}