Browse Source

Set both time/height header caches at the same time

0.15
Jonas Schnelli 8 years ago
parent
commit
928d4a9ac5
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D
  1. 2
      src/qt/clientmodel.cpp

2
src/qt/clientmodel.cpp

@ -82,6 +82,7 @@ int ClientModel::getHeaderTipHeight() const @@ -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 @@ -92,6 +93,7 @@ int64_t ClientModel::getHeaderTipTime() const
if (cachedBestHeaderTime == -1) {
LOCK(cs_main);
if (pindexBestHeader) {
cachedBestHeaderHeight = pindexBestHeader->nHeight;
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
}
}

Loading…
Cancel
Save