Skip to content

Commit fae4055

Browse files
author
MarcoFalke
committed
scripted-diff: Rename CBlockTreeDB -> BlockTreeDB
-BEGIN VERIFY SCRIPT- sed -i 's|CBlockTreeDB|BlockTreeDB|g' $( git grep -l CBlockTreeDB ) -END VERIFY SCRIPT-
1 parent faf6303 commit fae4055

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/node/blockstorage.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ static constexpr uint8_t DB_FLAG{'F'};
3434
static constexpr uint8_t DB_REINDEX_FLAG{'R'};
3535
static constexpr uint8_t DB_LAST_BLOCK{'l'};
3636
// Keys used in previous version that might still be found in the DB:
37-
// CBlockTreeDB::DB_TXINDEX_BLOCK{'T'};
38-
// CBlockTreeDB::DB_TXINDEX{'t'}
39-
// CBlockTreeDB::ReadFlag("txindex")
37+
// BlockTreeDB::DB_TXINDEX_BLOCK{'T'};
38+
// BlockTreeDB::DB_TXINDEX{'t'}
39+
// BlockTreeDB::ReadFlag("txindex")
4040

41-
bool CBlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo& info)
41+
bool BlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo& info)
4242
{
4343
return Read(std::make_pair(DB_BLOCK_FILES, nFile), info);
4444
}
4545

46-
bool CBlockTreeDB::WriteReindexing(bool fReindexing)
46+
bool BlockTreeDB::WriteReindexing(bool fReindexing)
4747
{
4848
if (fReindexing) {
4949
return Write(DB_REINDEX_FLAG, uint8_t{'1'});
@@ -52,17 +52,17 @@ bool CBlockTreeDB::WriteReindexing(bool fReindexing)
5252
}
5353
}
5454

55-
void CBlockTreeDB::ReadReindexing(bool& fReindexing)
55+
void BlockTreeDB::ReadReindexing(bool& fReindexing)
5656
{
5757
fReindexing = Exists(DB_REINDEX_FLAG);
5858
}
5959

60-
bool CBlockTreeDB::ReadLastBlockFile(int& nFile)
60+
bool BlockTreeDB::ReadLastBlockFile(int& nFile)
6161
{
6262
return Read(DB_LAST_BLOCK, nFile);
6363
}
6464

65-
bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
65+
bool BlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
6666
{
6767
CDBBatch batch(*this);
6868
for (const auto& [file, info] : fileInfo) {
@@ -75,12 +75,12 @@ bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockF
7575
return WriteBatch(batch, true);
7676
}
7777

78-
bool CBlockTreeDB::WriteFlag(const std::string& name, bool fValue)
78+
bool BlockTreeDB::WriteFlag(const std::string& name, bool fValue)
7979
{
8080
return Write(std::make_pair(DB_FLAG, name), fValue ? uint8_t{'1'} : uint8_t{'0'});
8181
}
8282

83-
bool CBlockTreeDB::ReadFlag(const std::string& name, bool& fValue)
83+
bool BlockTreeDB::ReadFlag(const std::string& name, bool& fValue)
8484
{
8585
uint8_t ch;
8686
if (!Read(std::make_pair(DB_FLAG, name), ch)) {
@@ -90,7 +90,7 @@ bool CBlockTreeDB::ReadFlag(const std::string& name, bool& fValue)
9090
return true;
9191
}
9292

93-
bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex, const util::SignalInterrupt& interrupt)
93+
bool BlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex, const util::SignalInterrupt& interrupt)
9494
{
9595
AssertLockHeld(::cs_main);
9696
std::unique_ptr<CDBIterator> pcursor(NewIterator());

src/node/blockstorage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SignalInterrupt;
4646

4747
namespace kernel {
4848
/** Access to the block database (blocks/index/) */
49-
class CBlockTreeDB : public CDBWrapper
49+
class BlockTreeDB : public CDBWrapper
5050
{
5151
public:
5252
using CDBWrapper::CDBWrapper;
@@ -63,7 +63,7 @@ class CBlockTreeDB : public CDBWrapper
6363
} // namespace kernel
6464

6565
namespace node {
66-
using kernel::CBlockTreeDB;
66+
using kernel::BlockTreeDB;
6767

6868
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
6969
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
@@ -212,7 +212,7 @@ class BlockManager
212212
*/
213213
std::multimap<CBlockIndex*, CBlockIndex*> m_blocks_unlinked;
214214

215-
std::unique_ptr<CBlockTreeDB> m_block_tree_db GUARDED_BY(::cs_main);
215+
std::unique_ptr<BlockTreeDB> m_block_tree_db GUARDED_BY(::cs_main);
216216

217217
bool WriteBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
218218
bool LoadBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);

src/node/chainstate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ static ChainstateLoadResult CompleteChainstateInitialization(
3737
const ChainstateLoadOptions& options) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
3838
{
3939
auto& pblocktree{chainman.m_blockman.m_block_tree_db};
40-
// new CBlockTreeDB tries to delete the existing file, which
40+
// new BlockTreeDB tries to delete the existing file, which
4141
// fails if it's still open from the previous loop. Close it first:
4242
pblocktree.reset();
43-
pblocktree = std::make_unique<CBlockTreeDB>(DBParams{
43+
pblocktree = std::make_unique<BlockTreeDB>(DBParams{
4444
.path = chainman.m_options.datadir / "blocks" / "index",
4545
.cache_bytes = static_cast<size_t>(cache_sizes.block_tree_db),
4646
.memory_only = options.block_tree_db_in_memory,

src/test/util/setup_common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#include <functional>
6464
#include <stdexcept>
6565

66-
using kernel::CBlockTreeDB;
66+
using kernel::BlockTreeDB;
6767
using kernel::ValidationCacheSizes;
6868
using node::ApplyArgsManOptions;
6969
using node::BlockAssembler;
@@ -182,7 +182,7 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto
182182
.notifications = chainman_opts.notifications,
183183
};
184184
m_node.chainman = std::make_unique<ChainstateManager>(m_node.kernel->interrupt, chainman_opts, blockman_opts);
185-
m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(DBParams{
185+
m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<BlockTreeDB>(DBParams{
186186
.path = m_args.GetDataDirNet() / "blocks" / "index",
187187
.cache_bytes = static_cast<size_t>(m_cache_sizes.block_tree_db),
188188
.memory_only = true});

0 commit comments

Comments
 (0)