diff options
author | James O'Beirne <james.obeirne@pm.me> | 2022-03-09 12:37:19 -0500 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2022-09-09 11:47:27 -0400 |
commit | 00eeb31c7660e2c28f189f77a6905dee946ef408 (patch) | |
tree | 9632e7eb98a9abf93706a7da1bd11910670a1da5 /src/node | |
parent | 37095c7dc4a85155c35e2473b6a20a53ae413cea (diff) |
scripted-diff: rename CChainState -> Chainstate
-BEGIN VERIFY SCRIPT-
sed -i 's/CChainState/Chainstate/g' $(git grep -l CChainState ':(exclude)doc/release-notes*')
-END VERIFY SCRIPT-
Co-authored-by: MacroFake <falke.marco@gmail.com>
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/blockstorage.cpp | 2 | ||||
-rw-r--r-- | src/node/blockstorage.h | 6 | ||||
-rw-r--r-- | src/node/chainstate.cpp | 10 | ||||
-rw-r--r-- | src/node/miner.cpp | 4 | ||||
-rw-r--r-- | src/node/miner.h | 6 | ||||
-rw-r--r-- | src/node/utxo_snapshot.h | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 42b6b017fe..57f81e6bb6 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -882,7 +882,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFile // We can't hold cs_main during ActivateBestChain even though we're accessing // the chainman unique_ptrs since ABC requires us not to be holding cs_main, so retrieve // the relevant pointers before the ABC call. - for (CChainState* chainstate : WITH_LOCK(::cs_main, return chainman.GetAll())) { + for (Chainstate* chainstate : WITH_LOCK(::cs_main, return chainman.GetAll())) { BlockValidationState state; if (!chainstate->ActivateBestChain(state, nullptr)) { LogPrintf("Failed to connect best block (%s)\n", state.ToString()); diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 9b76371aae..37d74ed102 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -26,7 +26,7 @@ class CBlockFileInfo; class CBlockUndo; class CChain; class CChainParams; -class CChainState; +class Chainstate; class ChainstateManager; struct CCheckpointData; struct FlatFilePos; @@ -75,12 +75,12 @@ struct PruneLockInfo { * Maintains a tree of blocks (stored in `m_block_index`) which is consulted * to determine where the most-work tip is. * - * This data is used mostly in `CChainState` - information about, e.g., + * This data is used mostly in `Chainstate` - information about, e.g., * candidate tips is not maintained here. */ class BlockManager { - friend CChainState; + friend Chainstate; friend ChainstateManager; private: diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index c4dd9ba6c5..3f1d6dd743 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -28,7 +28,7 @@ namespace node { ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSizes& cache_sizes, const ChainstateLoadOptions& options) { - auto is_coinsview_empty = [&](CChainState* chainstate) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { + auto is_coinsview_empty = [&](Chainstate* chainstate) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { return options.reindex || options.reindex_chainstate || chainstate->CoinsTip().GetBestBlock().IsNull(); }; @@ -101,7 +101,7 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize // At this point we're either in reindex or we've loaded a useful // block tree into BlockIndex()! - for (CChainState* chainstate : chainman.GetAll()) { + for (Chainstate* chainstate : chainman.GetAll()) { chainstate->InitCoinsDB( /*cache_size_bytes=*/cache_sizes.coins_db, /*in_memory=*/options.coins_db_in_memory, @@ -140,7 +140,7 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize if (!options.reindex) { auto chainstates{chainman.GetAll()}; if (std::any_of(chainstates.begin(), chainstates.end(), - [](const CChainState* cs) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { return cs->NeedsRedownload(); })) { + [](const Chainstate* cs) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { return cs->NeedsRedownload(); })) { return {ChainstateLoadStatus::FAILURE, strprintf(_("Witness data for blocks after height %d requires validation. Please restart with -reindex."), chainman.GetConsensus().SegwitHeight)}; }; @@ -151,13 +151,13 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager& chainman, const ChainstateLoadOptions& options) { - auto is_coinsview_empty = [&](CChainState* chainstate) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { + auto is_coinsview_empty = [&](Chainstate* chainstate) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { return options.reindex || options.reindex_chainstate || chainstate->CoinsTip().GetBestBlock().IsNull(); }; LOCK(cs_main); - for (CChainState* chainstate : chainman.GetAll()) { + for (Chainstate* chainstate : chainman.GetAll()) { if (!is_coinsview_empty(chainstate)) { const CBlockIndex* tip = chainstate->m_chain.Tip(); if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) { diff --git a/src/node/miner.cpp b/src/node/miner.cpp index f04742deeb..b277188c1f 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -62,7 +62,7 @@ BlockAssembler::Options::Options() nBlockMaxWeight = DEFAULT_BLOCK_MAX_WEIGHT; } -BlockAssembler::BlockAssembler(CChainState& chainstate, const CTxMemPool* mempool, const Options& options) +BlockAssembler::BlockAssembler(Chainstate& chainstate, const CTxMemPool* mempool, const Options& options) : chainparams{chainstate.m_chainman.GetParams()}, m_mempool(mempool), m_chainstate(chainstate) @@ -87,7 +87,7 @@ static BlockAssembler::Options DefaultOptions() return options; } -BlockAssembler::BlockAssembler(CChainState& chainstate, const CTxMemPool* mempool) +BlockAssembler::BlockAssembler(Chainstate& chainstate, const CTxMemPool* mempool) : BlockAssembler(chainstate, mempool, DefaultOptions()) {} void BlockAssembler::resetBlock() diff --git a/src/node/miner.h b/src/node/miner.h index 26454df3df..7269ce1186 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -148,7 +148,7 @@ private: const CChainParams& chainparams; const CTxMemPool* const m_mempool; - CChainState& m_chainstate; + Chainstate& m_chainstate; public: struct Options { @@ -157,8 +157,8 @@ public: CFeeRate blockMinFeeRate; }; - explicit BlockAssembler(CChainState& chainstate, const CTxMemPool* mempool); - explicit BlockAssembler(CChainState& chainstate, const CTxMemPool* mempool, const Options& options); + explicit BlockAssembler(Chainstate& chainstate, const CTxMemPool* mempool); + explicit BlockAssembler(Chainstate& chainstate, const CTxMemPool* mempool, const Options& options); /** Construct a new block template with coinbase to scriptPubKeyIn */ std::unique_ptr<CBlockTemplate> CreateNewBlock(const CScript& scriptPubKeyIn); diff --git a/src/node/utxo_snapshot.h b/src/node/utxo_snapshot.h index 401d4baaeb..9dd6f06997 100644 --- a/src/node/utxo_snapshot.h +++ b/src/node/utxo_snapshot.h @@ -11,7 +11,7 @@ namespace node { //! Metadata describing a serialized version of a UTXO set from which an -//! assumeutxo CChainState can be constructed. +//! assumeutxo Chainstate can be constructed. class SnapshotMetadata { public: |