aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-08-02 00:15:25 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-08-02 00:15:25 -0700
commit381e87cbd2720180c873f8028de3b827f4d2e1bd (patch)
tree9f73756a321e551a6b20132ee6a60ea655814426
parent8ce7915aad505fd6e57f599b5b43fc241d8b4cb4 (diff)
parent75578d60f350006ec77cbc47daef20b1726b96af (diff)
Merge pull request #1646 from Diapolo/only_upd_changed_vals
only update cached values in ClientModel::updateTimer() when they are changed, and set cached values before signal is emitted
-rw-r--r--src/qt/clientmodel.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 8fcc4e650e..43bce6f289 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -60,10 +60,12 @@ void ClientModel::updateTimer()
int newNumBlocksOfPeers = getNumBlocksOfPeers();
if(cachedNumBlocks != newNumBlocks || cachedNumBlocksOfPeers != newNumBlocksOfPeers)
- emit numBlocksChanged(newNumBlocks, newNumBlocksOfPeers);
+ {
+ cachedNumBlocks = newNumBlocks;
+ cachedNumBlocksOfPeers = newNumBlocksOfPeers;
- cachedNumBlocks = newNumBlocks;
- cachedNumBlocksOfPeers = newNumBlocksOfPeers;
+ emit numBlocksChanged(newNumBlocks, newNumBlocksOfPeers);
+ }
}
void ClientModel::updateNumConnections(int numConnections)