Skip to content

Commit c05db83

Browse files
committed
Merge #9013: Trivial: Explicitly pass const CChainParams& to LoadBlockIndexDB()
d0b01f3 Explicitly pass const CChainParams& to LoadBlockIndexDB() (Geoffrey Tsui)
2 parents bc785d7 + d0b01f3 commit c05db83

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
@@ -1323,7 +1323,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
13231323
CleanupBlockRevFiles();
13241324
}
13251325

1326-
if (!LoadBlockIndex()) {
1326+
if (!LoadBlockIndex(chainparams)) {
13271327
strLoadError = _("Error loading block database");
13281328
break;
13291329
}

src/main.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,9 +3972,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash)
39723972
return pindexNew;
39733973
}
39743974

3975-
bool static LoadBlockIndexDB()
3975+
bool static LoadBlockIndexDB(const CChainParams& chainparams)
39763976
{
3977-
const CChainParams& chainparams = Params();
39783977
if (!pblocktree->LoadBlockIndexGuts(InsertBlockIndex))
39793978
return false;
39803979

@@ -4303,10 +4302,10 @@ void UnloadBlockIndex()
43034302
fHavePruned = false;
43044303
}
43054304

4306-
bool LoadBlockIndex()
4305+
bool LoadBlockIndex(const CChainParams& chainparams)
43074306
{
43084307
// Load block index from databases
4309-
if (!fReindex && !LoadBlockIndexDB())
4308+
if (!fReindex && !LoadBlockIndexDB(chainparams))
43104309
return false;
43114310
return true;
43124311
}

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)