mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
refactor: Remove confusing BlockIndex global
This commit is contained in:
@@ -1589,7 +1589,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?"));
|
||||
}
|
||||
@@ -1869,8 +1869,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user