aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2017-04-20 09:51:41 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2017-05-31 10:53:47 +0200
commit222f3775cfee505a8f5cdb7f0e12af38998bd3fc (patch)
tree2af85e7c18bafd94c5a7520eb2bc8f4e3fc2b280
parent7da133772dd18b44316f7f12567e321eceec8838 (diff)
downloadbitcoin-222f3775cfee505a8f5cdb7f0e12af38998bd3fc.tar.xz
Set both time/height header caches at the same time
-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 cbc6ca1296..20d4687971 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();
}
}