diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-01-12 00:23:09 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-03-06 19:52:19 +0000 |
commit | 92fabcd443322dcfdf2b3477515fae79e8647d86 (patch) | |
tree | 5511c22adffa3eaccb75afdd2ec53c81550ff7d3 /src/init.cpp | |
parent | 43a32b739551b5a6cac8102afd52e2b9efc81726 (diff) |
Add LookupBlockIndex function
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index fdc2917dcf..269cd5c7fa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1459,8 +1459,9 @@ bool AppInitMain() // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way around). - if (!mapBlockIndex.empty() && mapBlockIndex.count(chainparams.GetConsensus().hashGenesisBlock) == 0) + if (!mapBlockIndex.empty() && !LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) { return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?")); + } // Check for changed -txindex state if (fTxIndex != gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { |