From fa1970f075292d7312654730a994a68c2ca8bc06 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 19 Apr 2022 11:59:09 +0200 Subject: [PATCH] Make BlockManager::LoadBlockIndex private --- src/node/blockstorage.h | 15 +++++++-------- src/validation.h | 1 - 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index a051e90808..7c6c379a47 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -80,6 +80,13 @@ class BlockManager friend ChainstateManager; private: + /** + * Load the blocktree off disk and into memory. Populate certain metadata + * per index entry (nStatus, nChainWork, nTimeMax, etc.) as well as peripheral + * collections like m_dirty_blockindex. + */ + bool LoadBlockIndex(const Consensus::Params& consensus_params) + EXCLUSIVE_LOCKS_REQUIRED(cs_main); void FlushBlockFile(bool fFinalize = false, bool finalize_undo = false); void FlushUndoFile(int block_file, bool finalize = false); bool FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigned int nHeight, CChain& active_chain, uint64_t nTime, bool fKnown); @@ -136,14 +143,6 @@ public: bool WriteBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); bool LoadBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); - /** - * Load the blocktree off disk and into memory. Populate certain metadata - * per index entry (nStatus, nChainWork, nTimeMax, etc.) as well as peripheral - * collections like m_dirty_blockindex. - */ - bool LoadBlockIndex(const Consensus::Params& consensus_params) - EXCLUSIVE_LOCKS_REQUIRED(cs_main); - /** Clear all data members. */ void Unload() EXCLUSIVE_LOCKS_REQUIRED(cs_main); diff --git a/src/validation.h b/src/validation.h index 53ea2d4aea..f49f4f7888 100644 --- a/src/validation.h +++ b/src/validation.h @@ -837,7 +837,6 @@ private: bool m_snapshot_validated{false}; CBlockIndex* m_best_invalid; - friend bool node::BlockManager::LoadBlockIndex(const Consensus::Params&); //! Internal helper for ActivateSnapshot(). [[nodiscard]] bool PopulateAndValidateSnapshot(