Skip to content

Commit d0b01f3

Browse files
committed
Explicitly pass const CChainParams& to LoadBlockIndexDB()
1 parent 9bdf526 commit d0b01f3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
13201320
CleanupBlockRevFiles();
13211321
}
13221322

1323-
if (!LoadBlockIndex()) {
1323+
if (!LoadBlockIndex(chainparams)) {
13241324
strLoadError = _("Error loading block database");
13251325
break;
13261326
}

src/main.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3966,9 +3966,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash)
39663966
return pindexNew;
39673967
}
39683968

3969-
bool static LoadBlockIndexDB()
3969+
bool static LoadBlockIndexDB(const CChainParams& chainparams)
39703970
{
3971-
const CChainParams& chainparams = Params();
39723971
if (!pblocktree->LoadBlockIndexGuts(InsertBlockIndex))
39733972
return false;
39743973

@@ -4297,10 +4296,10 @@ void UnloadBlockIndex()
42974296
fHavePruned = false;
42984297
}
42994298

4300-
bool LoadBlockIndex()
4299+
bool LoadBlockIndex(const CChainParams& chainparams)
43014300
{
43024301
// Load block index from databases
4303-
if (!fReindex && !LoadBlockIndexDB())
4302+
if (!fReindex && !LoadBlockIndexDB(chainparams))
43044303
return false;
43054304
return true;
43064305
}

src/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB
237237
/** Initialize a new block tree database + block data on disk */
238238
bool InitBlockIndex(const CChainParams& chainparams);
239239
/** Load the block tree and coins database from disk */
240-
bool LoadBlockIndex();
240+
bool LoadBlockIndex(const CChainParams& chainparams);
241241
/** Unload database information */
242242
void UnloadBlockIndex();
243243
/** Run an instance of the script checking thread */

0 commit comments

Comments
 (0)