Browse Source

Explicitly pass const CChainParams& to LoadBlockIndexDB()

0.14
Geoffrey Tsui 8 years ago
parent
commit
d0b01f3a85
  1. 2
      src/init.cpp
  2. 7
      src/main.cpp
  3. 2
      src/main.h

2
src/init.cpp

@ -1320,7 +1320,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) @@ -1320,7 +1320,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
CleanupBlockRevFiles();
}
if (!LoadBlockIndex()) {
if (!LoadBlockIndex(chainparams)) {
strLoadError = _("Error loading block database");
break;
}

7
src/main.cpp

@ -3966,9 +3966,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash) @@ -3966,9 +3966,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash)
return pindexNew;
}
bool static LoadBlockIndexDB()
bool static LoadBlockIndexDB(const CChainParams& chainparams)
{
const CChainParams& chainparams = Params();
if (!pblocktree->LoadBlockIndexGuts(InsertBlockIndex))
return false;
@ -4297,10 +4296,10 @@ void UnloadBlockIndex() @@ -4297,10 +4296,10 @@ void UnloadBlockIndex()
fHavePruned = false;
}
bool LoadBlockIndex()
bool LoadBlockIndex(const CChainParams& chainparams)
{
// Load block index from databases
if (!fReindex && !LoadBlockIndexDB())
if (!fReindex && !LoadBlockIndexDB(chainparams))
return false;
return true;
}

2
src/main.h

@ -237,7 +237,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB @@ -237,7 +237,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB
/** Initialize a new block tree database + block data on disk */
bool InitBlockIndex(const CChainParams& chainparams);
/** Load the block tree and coins database from disk */
bool LoadBlockIndex();
bool LoadBlockIndex(const CChainParams& chainparams);
/** Unload database information */
void UnloadBlockIndex();
/** Run an instance of the script checking thread */

Loading…
Cancel
Save