diff options
| author | MarcoFalke <[email protected]> | 2020-06-29 10:30:03 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-06-29 20:28:47 -0400 |
| commit | fa0dfdf447d5b84a1849dc823d8508463600136a (patch) | |
| tree | 98276aaab436fa0a748d26ab0a9b893b56607b5e /src/init.cpp | |
| parent | Merge #19204: p2p: Reduce inv traffic during IBD (diff) | |
| download | discoin-fa0dfdf447d5b84a1849dc823d8508463600136a.tar.xz discoin-fa0dfdf447d5b84a1849dc823d8508463600136a.zip | |
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 8d9566edc..40f673ad6 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); |