mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 13:42:10 +02:00
refactor: Move LoadGenesisBlock to ChainstateManager
The function does not need anything from any chainstate, so it should not sit in the Chainstate class. Also, mark it [[nodiscard]], and the one place that ignores the return value with (void). Also, change the error log strings to not include the __func__, which is redundant with -logsourcelocations. This is not a refactor, but this log is only for debugging extremely rare errors.
This commit is contained in:
@@ -62,7 +62,7 @@ static ChainstateLoadResult CompleteChainstateInitialization(
|
||||
// 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 ImportBlocks after the reindex completes.
|
||||
if (chainman.m_blockman.m_blockfiles_indexed && !chainman.ActiveChainstate().LoadGenesisBlock()) {
|
||||
if (chainman.m_blockman.m_blockfiles_indexed && !chainman.LoadGenesisBlock()) {
|
||||
return {ChainstateLoadStatus::FAILURE, _("Error initializing block database")};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user