diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-05-09 16:46:43 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-05-09 16:54:07 +0200 |
| commit | 82564e21e79092a7e28aa5d31d8fdbdb3fd970ca (patch) | |
| tree | 49973aaac1624a2c7d051cfd0bae532258a34068 /src/qt/clientmodel.cpp | |
| parent | Fix transaction tests (diff) | |
| parent | Remove NumBlocksOfPeers (diff) | |
| download | discoin-82564e21e79092a7e28aa5d31d8fdbdb3fd970ca.tar.xz discoin-82564e21e79092a7e28aa5d31d8fdbdb3fd970ca.zip | |
Merge pull request #4134
aa250f0 Remove NumBlocksOfPeers (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/clientmodel.cpp')
| -rw-r--r-- | src/qt/clientmodel.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 3c0564c20..d1f68ebd2 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -23,7 +23,7 @@ static const int64_t nClientStartupTime = GetTime(); ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), - cachedNumBlocks(0), cachedNumBlocksOfPeers(0), + cachedNumBlocks(0), cachedReindexing(0), cachedImporting(0), numBlocksAtStartup(-1), pollTimer(0) { @@ -101,19 +101,16 @@ void ClientModel::updateTimer() // Some quantities (such as number of blocks) change so fast that we don't want to be notified for each change. // Periodically check and update with a timer. int newNumBlocks = getNumBlocks(); - int newNumBlocksOfPeers = getNumBlocksOfPeers(); // check for changed number of blocks we have, number of blocks peers claim to have, reindexing state and importing state - if (cachedNumBlocks != newNumBlocks || cachedNumBlocksOfPeers != newNumBlocksOfPeers || + if (cachedNumBlocks != newNumBlocks || cachedReindexing != fReindex || cachedImporting != fImporting) { cachedNumBlocks = newNumBlocks; - cachedNumBlocksOfPeers = newNumBlocksOfPeers; cachedReindexing = fReindex; cachedImporting = fImporting; - // ensure we return the maximum of newNumBlocksOfPeers and newNumBlocks to not create weird displays in the GUI - emit numBlocksChanged(newNumBlocks, std::max(newNumBlocksOfPeers, newNumBlocks)); + emit numBlocksChanged(newNumBlocks); } emit bytesChanged(getTotalBytesRecv(), getTotalBytesSent()); @@ -166,11 +163,6 @@ enum BlockSource ClientModel::getBlockSource() const return BLOCK_SOURCE_NONE; } -int ClientModel::getNumBlocksOfPeers() const -{ - return GetNumBlocksOfPeers(); -} - QString ClientModel::getStatusBarWarnings() const { return QString::fromStdString(GetWarnings("statusbar")); |