From 928d4a9ac596db35bf3b8a0c8857cd6e7f87aa2a Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 20 Apr 2017 09:51:41 +0200 Subject: [PATCH] Set both time/height header caches at the same time --- src/qt/clientmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) 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(); } }