mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
validation: Remove global ::LoadGenesisBlock
This commit is contained in:
parent
9da106be4d
commit
4927c9e699
3 changed files with 3 additions and 8 deletions
|
@ -717,7 +717,7 @@ static void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImp
|
|||
fReindex = false;
|
||||
LogPrintf("Reindexing finished\n");
|
||||
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
|
||||
LoadGenesisBlock(chainparams);
|
||||
::ChainstateActive().LoadGenesisBlock(chainparams);
|
||||
}
|
||||
|
||||
// -loadblock=
|
||||
|
@ -1630,7 +1630,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
|||
// If we're not mid-reindex (based on disk + args), add a genesis block on disk
|
||||
// (otherwise we use the one already on disk).
|
||||
// This is called again in ThreadImport after the reindex completes.
|
||||
if (!fReindex && !LoadGenesisBlock(chainparams)) {
|
||||
if (!fReindex && !::ChainstateActive().LoadGenesisBlock(chainparams)) {
|
||||
strLoadError = _("Error initializing block database");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
|
|||
assert(!::ChainstateActive().CanFlushToDisk());
|
||||
::ChainstateActive().InitCoinsCache(1 << 23);
|
||||
assert(::ChainstateActive().CanFlushToDisk());
|
||||
if (!LoadGenesisBlock(chainparams)) {
|
||||
if (!::ChainstateActive().LoadGenesisBlock(chainparams)) {
|
||||
throw std::runtime_error("LoadGenesisBlock failed.");
|
||||
}
|
||||
|
||||
|
|
|
@ -4642,11 +4642,6 @@ bool CChainState::LoadGenesisBlock(const CChainParams& chainparams)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LoadGenesisBlock(const CChainParams& chainparams)
|
||||
{
|
||||
return ::ChainstateActive().LoadGenesisBlock(chainparams);
|
||||
}
|
||||
|
||||
void CChainState::LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFilePos* dbp)
|
||||
{
|
||||
// Map of disk positions for blocks with unknown parent (only used for reindex)
|
||||
|
|
Loading…
Reference in a new issue