mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Set both time/height header caches at the same time
This commit is contained in:
parent
610a91719c
commit
928d4a9ac5
@ -82,6 +82,7 @@ int ClientModel::getHeaderTipHeight() const
|
|||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
if (pindexBestHeader) {
|
if (pindexBestHeader) {
|
||||||
cachedBestHeaderHeight = pindexBestHeader->nHeight;
|
cachedBestHeaderHeight = pindexBestHeader->nHeight;
|
||||||
|
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cachedBestHeaderHeight;
|
return cachedBestHeaderHeight;
|
||||||
@ -92,6 +93,7 @@ int64_t ClientModel::getHeaderTipTime() const
|
|||||||
if (cachedBestHeaderTime == -1) {
|
if (cachedBestHeaderTime == -1) {
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
if (pindexBestHeader) {
|
if (pindexBestHeader) {
|
||||||
|
cachedBestHeaderHeight = pindexBestHeader->nHeight;
|
||||||
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
|
cachedBestHeaderTime = pindexBestHeader->GetBlockTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user