diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 894748a1355..fe59f57c6cc 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -34,16 +34,16 @@ static constexpr uint8_t DB_FLAG{'F'}; static constexpr uint8_t DB_REINDEX_FLAG{'R'}; static constexpr uint8_t DB_LAST_BLOCK{'l'}; // Keys used in previous version that might still be found in the DB: -// CBlockTreeDB::DB_TXINDEX_BLOCK{'T'}; -// CBlockTreeDB::DB_TXINDEX{'t'} -// CBlockTreeDB::ReadFlag("txindex") +// BlockTreeDB::DB_TXINDEX_BLOCK{'T'}; +// BlockTreeDB::DB_TXINDEX{'t'} +// BlockTreeDB::ReadFlag("txindex") -bool CBlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo& info) +bool BlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo& info) { return Read(std::make_pair(DB_BLOCK_FILES, nFile), info); } -bool CBlockTreeDB::WriteReindexing(bool fReindexing) +bool BlockTreeDB::WriteReindexing(bool fReindexing) { if (fReindexing) { return Write(DB_REINDEX_FLAG, uint8_t{'1'}); @@ -52,17 +52,17 @@ bool CBlockTreeDB::WriteReindexing(bool fReindexing) } } -void CBlockTreeDB::ReadReindexing(bool& fReindexing) +void BlockTreeDB::ReadReindexing(bool& fReindexing) { fReindexing = Exists(DB_REINDEX_FLAG); } -bool CBlockTreeDB::ReadLastBlockFile(int& nFile) +bool BlockTreeDB::ReadLastBlockFile(int& nFile) { return Read(DB_LAST_BLOCK, nFile); } -bool CBlockTreeDB::WriteBatchSync(const std::vector>& fileInfo, int nLastFile, const std::vector& blockinfo) +bool BlockTreeDB::WriteBatchSync(const std::vector>& fileInfo, int nLastFile, const std::vector& blockinfo) { CDBBatch batch(*this); for (const auto& [file, info] : fileInfo) { @@ -75,12 +75,12 @@ bool CBlockTreeDB::WriteBatchSync(const std::vector insertBlockIndex, const util::SignalInterrupt& interrupt) +bool BlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function insertBlockIndex, const util::SignalInterrupt& interrupt) { AssertLockHeld(::cs_main); std::unique_ptr pcursor(NewIterator()); diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 58608fe015e..2bd5218ad0b 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -46,7 +46,7 @@ class SignalInterrupt; namespace kernel { /** Access to the block database (blocks/index/) */ -class CBlockTreeDB : public CDBWrapper +class BlockTreeDB : public CDBWrapper { public: using CDBWrapper::CDBWrapper; @@ -63,7 +63,7 @@ public: } // namespace kernel namespace node { -using kernel::CBlockTreeDB; +using kernel::BlockTreeDB; /** The pre-allocation chunk size for blk?????.dat files (since 0.8) */ static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB @@ -212,7 +212,7 @@ public: */ std::multimap m_blocks_unlinked; - std::unique_ptr m_block_tree_db GUARDED_BY(::cs_main); + std::unique_ptr m_block_tree_db GUARDED_BY(::cs_main); bool WriteBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); bool LoadBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 0828f648567..ae1457a87ea 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -37,10 +37,10 @@ static ChainstateLoadResult CompleteChainstateInitialization( const ChainstateLoadOptions& options) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { auto& pblocktree{chainman.m_blockman.m_block_tree_db}; - // new CBlockTreeDB tries to delete the existing file, which + // new BlockTreeDB tries to delete the existing file, which // fails if it's still open from the previous loop. Close it first: pblocktree.reset(); - pblocktree = std::make_unique(DBParams{ + pblocktree = std::make_unique(DBParams{ .path = chainman.m_options.datadir / "blocks" / "index", .cache_bytes = static_cast(cache_sizes.block_tree_db), .memory_only = options.block_tree_db_in_memory, diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 7e9cafc6fd9..880bb0f9d2f 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -63,7 +63,7 @@ #include #include -using kernel::CBlockTreeDB; +using kernel::BlockTreeDB; using kernel::ValidationCacheSizes; using node::ApplyArgsManOptions; using node::BlockAssembler; @@ -182,7 +182,7 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto .notifications = chainman_opts.notifications, }; m_node.chainman = std::make_unique(m_node.kernel->interrupt, chainman_opts, blockman_opts); - m_node.chainman->m_blockman.m_block_tree_db = std::make_unique(DBParams{ + m_node.chainman->m_blockman.m_block_tree_db = std::make_unique(DBParams{ .path = m_args.GetDataDirNet() / "blocks" / "index", .cache_bytes = static_cast(m_cache_sizes.block_tree_db), .memory_only = true});