![]() |
Bitcoin Core
25.99.0
P2P Digital Currency
|
#include <validation.h>
Public Member Functions | |
void | ResetIbd () |
Reset the ibd cache to its initial state. More... | |
void | JumpOutOfIbd () |
Toggle IsInitialBlockDownload from true to false. More... | |
![]() | |
ChainstateManager (const util::SignalInterrupt &interrupt, Options options, node::BlockManager::Options blockman_options) | |
const CChainParams & | GetParams () const |
const Consensus::Params & | GetConsensus () const |
bool | ShouldCheckBlockIndex () const |
const arith_uint256 & | MinimumChainWork () const |
const uint256 & | AssumedValidBlock () const |
kernel::Notifications & | GetNotifications () const |
void | CheckBlockIndex () |
Make various assertions about the state of the block index. More... | |
RecursiveMutex & | GetMutex () const LOCK_RETURNED( |
Alias for cs_main. More... | |
int32_t nBlockSequenceId | GUARDED_BY (::cs_main) |
Every received block is assigned a unique and increasing identifier, so we know which one to give priority in case of a fork. More... | |
void | ResetBlockSequenceCounters () EXCLUSIVE_LOCKS_REQUIRED( |
CBlockIndex *m_best_header | GUARDED_BY (::cs_main) |
Best header we've seen so far (used for getheaders queries' starting points). More... | |
bool | ActivateSnapshot (AutoFile &coins_file, const node::SnapshotMetadata &metadata, bool in_memory) |
Construct and activate a Chainstate on the basis of UTXO snapshot data. More... | |
CChain & | ActiveChain () const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) |
int | ActiveHeight () const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) |
CBlockIndex * | ActiveTip () const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) |
node::BlockMap & | BlockIndex () EXCLUSIVE_LOCKS_REQUIRED( |
bool | IsSnapshotActive () const |
std::optional< uint256 > | SnapshotBlockhash () const |
bool | IsSnapshotValidated () const EXCLUSIVE_LOCKS_REQUIRED( |
Is there a snapshot in use and has it been fully validated? More... | |
bool | IsInitialBlockDownload () const |
Check whether we are doing an initial block download (synchronizing from disk or network) More... | |
void | LoadExternalBlockFile (CAutoFile &file_in, FlatFilePos *dbp=nullptr, std::multimap< uint256, FlatFilePos > *blocks_with_unknown_parent=nullptr) |
Import blocks from an external file. More... | |
bool | ProcessNewBlock (const std::shared_ptr< const CBlock > &block, bool force_processing, bool min_pow_checked, bool *new_block) LOCKS_EXCLUDED(cs_main) |
Process an incoming block. More... | |
bool | ProcessNewBlockHeaders (const std::vector< CBlockHeader > &block, bool min_pow_checked, BlockValidationState &state, const CBlockIndex **ppindex=nullptr) LOCKS_EXCLUDED(cs_main) |
Process incoming block headers. More... | |
bool | AcceptBlock (const std::shared_ptr< const CBlock > &pblock, BlockValidationState &state, CBlockIndex **ppindex, bool fRequested, const FlatFilePos *dbp, bool *fNewBlock, bool min_pow_checked) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
Sufficiently validate a block for disk storage (and store on disk). More... | |
void | ReceivedBlockTransactions (const CBlock &block, CBlockIndex *pindexNew, const FlatFilePos &pos) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS). More... | |
MempoolAcceptResult | ProcessTransaction (const CTransactionRef &tx, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
Try to add a transaction to the memory pool. More... | |
bool | LoadBlockIndex () EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
Load the block tree and coins database from disk, initializing state if we're running with -reindex. More... | |
std::vector< unsigned char > | GenerateCoinbaseCommitment (CBlock &block, const CBlockIndex *pindexPrev) const |
Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks). More... | |
void | ReportHeadersPresync (const arith_uint256 &work, int64_t height, int64_t timestamp) |
This is used by net_processing to report pre-synchronization progress of headers, as headers are not yet fed to validation during that time, but validation is (for now) responsible for logging and signalling through NotifyHeaderTip, so it needs this information. More... | |
Additional Inherited Members | |
![]() | |
using | Options = kernel::ChainstateManagerOpts |
![]() | |
const util::SignalInterrupt & | m_interrupt |
const Options | m_options |
std::thread | m_thread_load |
node::BlockManager | m_blockman |
A single BlockManager instance is shared across each constructed chainstate to avoid duplicating block metadata. More... | |
std::atomic< bool > | m_cached_finished_ibd {false} |
Whether initial block download has ended and IsInitialBlockDownload should return false from now on. More... | |
int32_t | nBlockReverseSequenceId = -1 |
Decreasing counter (used by subsequent preciousblock calls). More... | |
arith_uint256 | nLastPreciousChainwork = 0 |
chainwork for the last block that preciousblock has been applied to. More... | |
std::set< CBlockIndex * > | m_failed_blocks |
In order to efficiently track invalidity of headers, we keep the set of blocks which we tried to connect and found to be invalid here (ie which were set to BLOCK_FAILED_VALID since the last restart). More... | |
int64_t | m_total_coinstip_cache {0} |
The total number of bytes available for us to use across all in-memory coins caches. More... | |
int64_t | m_total_coinsdb_cache {0} |
The total number of bytes available for us to use across all leveldb coins databases. More... | |
Chainstate &InitializeChainstate(CTxMemPool *mempool) EXCLUSIVE_LOCKS_REQUIRED(std::vector< Chainstate * | GetAll )() |
Instantiate a new chainstate. More... | |
VersionBitsCache | m_versionbitscache |
Track versionbit status. More... | |
bool DetectSnapshotChainstate(CTxMemPool *mempool) EXCLUSIVE_LOCKS_REQUIRED(void ResetChainstates() EXCLUSIVE_LOCKS_REQUIRED(Chainstate &ActivateExistingSnapshot(CTxMemPool *mempool, uint256 base_blockhash) EXCLUSIVE_LOCKS_REQUIRED(bool ValidatedSnapshotCleanup() EXCLUSIVE_LOCKS_REQUIRED | ~ChainstateManager )() |
When starting up, search the datadir for a chainstate based on a UTXO snapshot that is in the process of being validated. More... | |
Definition at line 12 of file validation.h.
void TestChainstateManager::JumpOutOfIbd | ( | ) |
Toggle IsInitialBlockDownload from true to false.
Definition at line 18 of file validation.cpp.
void TestChainstateManager::ResetIbd | ( | ) |
Reset the ibd cache to its initial state.
Definition at line 12 of file validation.cpp.