From 4927c9e6991b09a36a41aab93a0e05332d899611 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 25 Aug 2020 22:29:31 -0400 Subject: [PATCH] validation: Remove global ::LoadGenesisBlock --- src/init.cpp | 4 ++-- src/test/util/setup_common.cpp | 2 +- src/validation.cpp | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index befba2eb2d..ea222f393e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -717,7 +717,7 @@ static void ThreadImport(ChainstateManager& chainman, std::vector 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; } diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 1ffe435531..46b28190d3 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -179,7 +179,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector