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

@@ -1207,7 +1207,7 @@ RPCHelpMan getblockchaininfo()
UniValue obj(UniValue::VOBJ);
obj.pushKV("chain", Params().NetworkIDString());
obj.pushKV("blocks", height);
obj.pushKV("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1);
obj.pushKV("headers", chainman.pindexBestHeader ? chainman.pindexBestHeader->nHeight : -1);
obj.pushKV("bestblockhash", tip->GetBlockHash().GetHex());
obj.pushKV("difficulty", (double)GetDifficulty(tip));
obj.pushKV("time", (int64_t)tip->nTime);