Merge 636991d0c0 into merged_master (Bitcoin PR bitcoin/bitcoin#25264)

This commit is contained in:
James Dorfman 2024-09-06 19:31:45 +00:00
commit ae633bfd3b
3 changed files with 4 additions and 4 deletions

View file

@ -334,9 +334,9 @@ bool BlockManager::WriteBlockIndexDB()
return true;
}
bool BlockManager::LoadBlockIndexDB()
bool BlockManager::LoadBlockIndexDB(const Consensus::Params& consensus_params)
{
if (!LoadBlockIndex(::Params().GetConsensus())) {
if (!LoadBlockIndex(consensus_params)) {
return false;
}

View file

@ -160,7 +160,7 @@ public:
std::unique_ptr<CBlockTreeDB> m_block_tree_db GUARDED_BY(::cs_main);
bool WriteBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
bool LoadBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
bool LoadBlockIndexDB(const Consensus::Params& consensus_params) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
CBlockIndex* AddToBlockIndex(const CBlockHeader& block, CBlockIndex*& best_header) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
/** Create a new block index entry for a given block hash */

View file

@ -4597,7 +4597,7 @@ bool ChainstateManager::LoadBlockIndex()
// Load block index from databases
bool needs_init = fReindex;
if (!fReindex) {
bool ret = m_blockman.LoadBlockIndexDB();
bool ret = m_blockman.LoadBlockIndexDB(GetConsensus());
if (!ret) return false;
std::vector<CBlockIndex*> vSortedByHeight{m_blockman.GetAllBlockIndices()};