Skip to content

Commit 4927c9e

Browse files
committed
validation: Remove global ::LoadGenesisBlock
1 parent 9da106b commit 4927c9e

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ static void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImp
717717
fReindex = false;
718718
LogPrintf("Reindexing finished\n");
719719
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
720-
LoadGenesisBlock(chainparams);
720+
::ChainstateActive().LoadGenesisBlock(chainparams);
721721
}
722722

723723
// -loadblock=
@@ -1630,7 +1630,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
16301630
// If we're not mid-reindex (based on disk + args), add a genesis block on disk
16311631
// (otherwise we use the one already on disk).
16321632
// This is called again in ThreadImport after the reindex completes.
1633-
if (!fReindex && !LoadGenesisBlock(chainparams)) {
1633+
if (!fReindex && !::ChainstateActive().LoadGenesisBlock(chainparams)) {
16341634
strLoadError = _("Error initializing block database");
16351635
break;
16361636
}

src/test/util/setup_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
179179
assert(!::ChainstateActive().CanFlushToDisk());
180180
::ChainstateActive().InitCoinsCache(1 << 23);
181181
assert(::ChainstateActive().CanFlushToDisk());
182-
if (!LoadGenesisBlock(chainparams)) {
182+
if (!::ChainstateActive().LoadGenesisBlock(chainparams)) {
183183
throw std::runtime_error("LoadGenesisBlock failed.");
184184
}
185185

src/validation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4642,11 +4642,6 @@ bool CChainState::LoadGenesisBlock(const CChainParams& chainparams)
46424642
return true;
46434643
}
46444644

4645-
bool LoadGenesisBlock(const CChainParams& chainparams)
4646-
{
4647-
return ::ChainstateActive().LoadGenesisBlock(chainparams);
4648-
}
4649-
46504645
void CChainState::LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFilePos* dbp)
46514646
{
46524647
// Map of disk positions for blocks with unknown parent (only used for reindex)

0 commit comments

Comments
 (0)