mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-15 11:36:00 -05:00
kernel: pass params to BlockManager rather than using a global
This commit is contained in:
parent
1c7ef0abd1
commit
a4741bd8d4
3 changed files with 4 additions and 4 deletions
|
@ -318,9 +318,9 @@ bool BlockManager::WriteBlockIndexDB()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlockManager::LoadBlockIndexDB()
|
bool BlockManager::LoadBlockIndexDB(const Consensus::Params& consensus_params)
|
||||||
{
|
{
|
||||||
if (!LoadBlockIndex(::Params().GetConsensus())) {
|
if (!LoadBlockIndex(consensus_params)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ public:
|
||||||
std::unique_ptr<CBlockTreeDB> m_block_tree_db GUARDED_BY(::cs_main);
|
std::unique_ptr<CBlockTreeDB> m_block_tree_db GUARDED_BY(::cs_main);
|
||||||
|
|
||||||
bool WriteBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::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);
|
CBlockIndex* AddToBlockIndex(const CBlockHeader& block, CBlockIndex*& best_header) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||||
/** Create a new block index entry for a given block hash */
|
/** Create a new block index entry for a given block hash */
|
||||||
|
|
|
@ -4158,7 +4158,7 @@ bool ChainstateManager::LoadBlockIndex()
|
||||||
// Load block index from databases
|
// Load block index from databases
|
||||||
bool needs_init = fReindex;
|
bool needs_init = fReindex;
|
||||||
if (!fReindex) {
|
if (!fReindex) {
|
||||||
bool ret = m_blockman.LoadBlockIndexDB();
|
bool ret = m_blockman.LoadBlockIndexDB(GetConsensus());
|
||||||
if (!ret) return false;
|
if (!ret) return false;
|
||||||
|
|
||||||
std::vector<CBlockIndex*> vSortedByHeight{m_blockman.GetAllBlockIndices()};
|
std::vector<CBlockIndex*> vSortedByHeight{m_blockman.GetAllBlockIndices()};
|
||||||
|
|
Loading…
Add table
Reference in a new issue