From 75578d60f350006ec77cbc47daef20b1726b96af Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 1 Aug 2012 23:32:32 +0200 Subject: [PATCH] only update cached values in ClientModel::updateTimer() when they are changed --- src/qt/clientmodel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 8fcc4e65..43bce6f2 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)