mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 10:30:52 +00:00
Set both time/height header caches at the same time
This commit is contained in:
parent
7da133772d
commit
222f3775cf
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user