aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <[email protected]>2017-04-20 09:51:41 +0200
committerJonas Schnelli <[email protected]>2017-05-31 10:53:47 +0200
commit222f3775cfee505a8f5cdb7f0e12af38998bd3fc (patch)
tree2af85e7c18bafd94c5a7520eb2bc8f4e3fc2b280 /src/qt/clientmodel.cpp
parentDeclare headers height/time cache mutable, re-set the methods const (diff)
downloaddiscoin-222f3775cfee505a8f5cdb7f0e12af38998bd3fc.tar.xz
discoin-222f3775cfee505a8f5cdb7f0e12af38998bd3fc.zip
Set both time/height header caches at the same time
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index cbc6ca129..20d468797 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -82,6 +82,7 @@ int ClientModel::getHeaderTipHeight() const
LOCK(cs_main);
if (pindexBestHeader) {
cachedBestHeaderHeight = pindexBestHeader->nHeight;
+ cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
}
}
return cachedBestHeaderHeight;
@@ -92,6 +93,7 @@ int64_t ClientModel::getHeaderTipTime() const
if (cachedBestHeaderTime == -1) {
LOCK(cs_main);
if (pindexBestHeader) {
+ cachedBestHeaderHeight = pindexBestHeader->nHeight;
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
}
}