aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-08-02 07:50:22 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-08-02 07:49:32 +0200
commitfae405556d56f6f13ce57f69a06b9ec1e825422b (patch)
tree2767fa7fc53edbd4603ff9933129e56ceac5f730
parentfaf63039cce40f5cf8dea5a1d24945773c3433a1 (diff)
scripted-diff: Rename CBlockTreeDB -> BlockTreeDB
-BEGIN VERIFY SCRIPT- sed -i 's|CBlockTreeDB|BlockTreeDB|g' $( git grep -l CBlockTreeDB ) -END VERIFY SCRIPT-
-rw-r--r--src/node/blockstorage.cpp22
-rw-r--r--src/node/blockstorage.h6
-rw-r--r--src/node/chainstate.cpp4
-rw-r--r--src/test/util/setup_common.cpp4
4 files changed, 18 insertions, 18 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index 894748a135..fe59f57c6c 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<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
+bool BlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
{
CDBBatch batch(*this);
for (const auto& [file, info] : fileInfo) {
@@ -75,12 +75,12 @@ bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockF
return WriteBatch(batch, true);
}
-bool CBlockTreeDB::WriteFlag(const std::string& name, bool fValue)
+bool BlockTreeDB::WriteFlag(const std::string& name, bool fValue)
{
return Write(std::make_pair(DB_FLAG, name), fValue ? uint8_t{'1'} : uint8_t{'0'});
}
-bool CBlockTreeDB::ReadFlag(const std::string& name, bool& fValue)
+bool BlockTreeDB::ReadFlag(const std::string& name, bool& fValue)
{
uint8_t ch;
if (!Read(std::make_pair(DB_FLAG, name), ch)) {
@@ -90,7 +90,7 @@ bool CBlockTreeDB::ReadFlag(const std::string& name, bool& fValue)
return true;
}
-bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex, const util::SignalInterrupt& interrupt)
+bool BlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex, const util::SignalInterrupt& interrupt)
{
AssertLockHeld(::cs_main);
std::unique_ptr<CDBIterator> pcursor(NewIterator());
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h
index 58608fe015..2bd5218ad0 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<CBlockIndex*, CBlockIndex*> m_blocks_unlinked;
- std::unique_ptr<CBlockTreeDB> m_block_tree_db GUARDED_BY(::cs_main);
+ std::unique_ptr<BlockTreeDB> 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 0828f64856..ae1457a87e 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<CBlockTreeDB>(DBParams{
+ pblocktree = std::make_unique<BlockTreeDB>(DBParams{
.path = chainman.m_options.datadir / "blocks" / "index",
.cache_bytes = static_cast<size_t>(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 7e9cafc6fd..880bb0f9d2 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -63,7 +63,7 @@
#include <functional>
#include <stdexcept>
-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<ChainstateManager>(m_node.kernel->interrupt, chainman_opts, blockman_opts);
- m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(DBParams{
+ m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<BlockTreeDB>(DBParams{
.path = m_args.GetDataDirNet() / "blocks" / "index",
.cache_bytes = static_cast<size_t>(m_cache_sizes.block_tree_db),
.memory_only = true});