diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-06-29 10:30:03 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-06-29 20:28:47 -0400 |
commit | fa0dfdf447d5b84a1849dc823d8508463600136a (patch) | |
tree | 98276aaab436fa0a748d26ab0a9b893b56607b5e /src/init.cpp | |
parent | 8edfc1715a02cbaf52420d3c4e71f67ff9af0b41 (diff) | |
download | bitcoin-fa0dfdf447d5b84a1849dc823d8508463600136a.tar.xz |
refactor: Remove confusing BlockIndex global
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8d9566edc3..40f673ad69 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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); |