mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
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>
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user