Merge 915ac8a861 into merged_master (Bitcoin PR #19413)

This commit is contained in:
Andrew Poelstra 2020-11-26 01:09:19 +00:00
commit 8e770d3f21
7 changed files with 37 additions and 42 deletions

View file

@ -1642,7 +1642,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
// If the loaded chain has a wrong genesis, bail out immediately
// (we're likely using a testnet datadir, or the other way around).
if (!::BlockIndex().empty() &&
if (!chainman.BlockIndex().empty() &&
!LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) {
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
}
@ -1922,8 +1922,8 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
//// debug print
{
LOCK(cs_main);
LogPrintf("block tree size = %u\n", ::BlockIndex().size());
chain_active_height = ::ChainActive().Height();
LogPrintf("block tree size = %u\n", chainman.BlockIndex().size());
chain_active_height = chainman.ActiveChain().Height();
}
LogPrintf("nBestHeight = %d\n", chain_active_height);