move-mostly: Make pindexBestHeader a ChainMan member

[META] In the next commit, we move the clearing of pindexBestHeader to
       ChainstateManager::Unload()
This commit is contained in:
Carl Dong
2020-12-24 16:18:46 -05:00
parent 5d670173a3
commit 0d567daf23
8 changed files with 45 additions and 42 deletions

View File

@@ -1664,9 +1664,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
tip_info->block_time = chainman.ActiveChain().Tip() ? chainman.ActiveChain().Tip()->GetBlockTime() : Params().GenesisBlock().GetBlockTime();
tip_info->verification_progress = GuessVerificationProgress(Params().TxData(), chainman.ActiveChain().Tip());
}
if (tip_info && ::pindexBestHeader) {
tip_info->header_height = ::pindexBestHeader->nHeight;
tip_info->header_time = ::pindexBestHeader->GetBlockTime();
if (tip_info && chainman.pindexBestHeader) {
tip_info->header_height = chainman.pindexBestHeader->nHeight;
tip_info->header_time = chainman.pindexBestHeader->GetBlockTime();
}
}
LogPrintf("nBestHeight = %d\n", chain_active_height);