Skip to content

Commit

Permalink
Set both time/height header caches at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschnelli committed Apr 20, 2017
1 parent 610a917 commit 928d4a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/qt/clientmodel.cpp
Expand Up @@ -82,6 +82,7 @@ int ClientModel::getHeaderTipHeight() const
LOCK(cs_main);
if (pindexBestHeader) {
cachedBestHeaderHeight = pindexBestHeader->nHeight;
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
}
}
return cachedBestHeaderHeight;
Expand All @@ -92,6 +93,7 @@ int64_t ClientModel::getHeaderTipTime() const
if (cachedBestHeaderTime == -1) {
LOCK(cs_main);
if (pindexBestHeader) {
cachedBestHeaderHeight = pindexBestHeader->nHeight;
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
}
}
Expand Down

0 comments on commit 928d4a9

Please sign in to comment.