![]() |
Bitcoin Core
0.21.1
P2P Digital Currency
|
#include <amount.h>#include <coins.h>#include <crypto/common.h>#include <fs.h>#include <optional.h>#include <policy/feerate.h>#include <protocol.h>#include <script/script_error.h>#include <sync.h>#include <txmempool.h>#include <txdb.h>#include <versionbits.h>#include <serialize.h>#include <atomic>#include <map>#include <memory>#include <set>#include <stdint.h>#include <string>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| struct | BlockHasher |
| class | CScriptCheck |
| Check if transaction will be BIP 68 final in the next block to be created. More... | |
| class | CVerifyDB |
| RAII wrapper for VerifyDB: Verify consistency of the block and coin databases. More... | |
| struct | CBlockIndexWorkComparator |
| class | BlockManager |
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-work tip is. More... | |
| class | CoinsViews |
| A convenience class for constructing the CCoinsView* hierarchy used to facilitate access to the UTXO set. More... | |
| class | CChainState |
| CChainState stores and provides an API to update our local knowledge of the current best chain. More... | |
| class | ChainstateManager |
| Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate generated by downloading blocks, and an optional snapshot chainstate loaded from a UTXO snapshot. More... | |
Typedefs | |
| typedef std::unordered_map < uint256, CBlockIndex *, BlockHasher > | BlockMap |
Enumerations | |
| enum | SynchronizationState { SynchronizationState::INIT_REINDEX, SynchronizationState::INIT_DOWNLOAD, SynchronizationState::POST_INIT } |
| Current sync state passed to tip changed callbacks. More... | |
| enum | DisconnectResult { DISCONNECT_OK, DISCONNECT_UNCLEAN, DISCONNECT_FAILED } |
| enum | FlushStateMode { FlushStateMode::NONE, FlushStateMode::IF_NEEDED, FlushStateMode::PERIODIC, FlushStateMode::ALWAYS } |
| enum | CoinsCacheSizeState { CoinsCacheSizeState::CRITICAL = 2, CoinsCacheSizeState::LARGE = 1, CoinsCacheSizeState::OK = 0 } |
Functions | |
| FILE * | OpenBlockFile (const FlatFilePos &pos, bool fReadOnly=false) |
| Open a block file (blk?????.dat) More... | |
| fs::path | GetBlockPosFilename (const FlatFilePos &pos) |
| Translation to a filesystem path. More... | |
| void | LoadExternalBlockFile (const CChainParams &chainparams, FILE *fileIn, FlatFilePos *dbp=nullptr) |
| Import blocks from an external file. More... | |
| bool | LoadGenesisBlock (const CChainParams &chainparams) |
| Ensures we have a genesis block in the block tree, possibly writing one to disk. More... | |
| void | UnloadBlockIndex (CTxMemPool *mempool, ChainstateManager &chainman) |
| Unload database information. More... | |
| void | ThreadScriptCheck (int worker_num) |
| Run an instance of the script checking thread. More... | |
| CTransactionRef | GetTransaction (const CBlockIndex *const block_index, const CTxMemPool *const mempool, const uint256 &hash, const Consensus::Params &consensusParams, uint256 &hashBlock) |
| Return transaction from the block at block_index. More... | |
| bool | ActivateBestChain (BlockValidationState &state, const CChainParams &chainparams, std::shared_ptr< const CBlock > pblock=std::shared_ptr< const CBlock >()) |
| Find the best known block, and make it the tip of the block chain. More... | |
| CAmount | GetBlockSubsidy (int nHeight, const Consensus::Params &consensusParams) |
| double | GuessVerificationProgress (const ChainTxData &data, const CBlockIndex *pindex) |
| Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). More... | |
| uint64_t | CalculateCurrentUsage () |
| Calculate the amount of disk space the block & undo files currently use. More... | |
| void | UnlinkPrunedFiles (const std::set< int > &setFilesToPrune) |
| Actually unlink the specified files. More... | |
| void | PruneBlockFilesManual (int nManualPruneHeight) |
| Prune block files up to a given height. More... | |
| bool | AcceptToMemoryPool (CTxMemPool &pool, TxValidationState &state, const CTransactionRef &tx, std::list< CTransactionRef > *plTxnReplaced, bool bypass_limits, bool test_accept=false, CAmount *fee_out=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| (try to) add transaction to memory pool plTxnReplaced will be appended to with all transactions replaced from mempool More... | |
| ThresholdState | VersionBitsTipState (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
| Get the BIP9 state for a given deployment at the current tip. More... | |
| BIP9Stats | VersionBitsTipStatistics (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
| Get the numerical statistics for the BIP9 state for a given deployment at the current tip. More... | |
| int | VersionBitsTipStateSinceHeight (const Consensus::Params ¶ms, Consensus::DeploymentPos pos) |
| Get the block height at which the BIP9 deployment switched into the state for the block building on the current tip. More... | |
| void | UpdateCoins (const CTransaction &tx, CCoinsViewCache &inputs, int nHeight) |
| Apply the effects of this transaction on the UTXO set represented by view. More... | |
| bool | CheckFinalTx (const CTransaction &tx, int flags=-1) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| Transaction validation functions. More... | |
| bool | TestLockPointValidity (const LockPoints *lp) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| Test whether the LockPoints height and time are still valid on the current chain. More... | |
| void | InitScriptExecutionCache () |
| Initializes the script-execution cache. More... | |
| bool | ReadBlockFromDisk (CBlock &block, const FlatFilePos &pos, const Consensus::Params &consensusParams) |
| Functions for disk access for blocks. More... | |
| bool | ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex, const Consensus::Params &consensusParams) |
| bool | ReadRawBlockFromDisk (std::vector< uint8_t > &block, const FlatFilePos &pos, const CMessageHeader::MessageStartChars &message_start) |
| bool | ReadRawBlockFromDisk (std::vector< uint8_t > &block, const CBlockIndex *pindex, const CMessageHeader::MessageStartChars &message_start) |
| bool | UndoReadFromDisk (CBlockUndo &blockundo, const CBlockIndex *pindex) |
| bool | CheckBlock (const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW=true, bool fCheckMerkleRoot=true) |
| Functions for validating blocks and updating the block tree. More... | |
| bool | TestBlockValidity (BlockValidationState &state, const CChainParams &chainparams, const CBlock &block, CBlockIndex *pindexPrev, bool fCheckPOW=true, bool fCheckMerkleRoot=true) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| Check a block is completely valid from start to finish (only works on top of our current best block) More... | |
| bool | IsWitnessEnabled (const CBlockIndex *pindexPrev, const Consensus::Params ¶ms) |
| Check whether witness commitments are required for a block, and whether to enforce NULLDUMMY (BIP 147) rules. More... | |
| void | UpdateUncommittedBlockStructures (CBlock &block, const CBlockIndex *pindexPrev, const Consensus::Params &consensusParams) |
| Update uncommitted block structures (currently: only the witness reserved value). More... | |
| std::vector< unsigned char > | GenerateCoinbaseCommitment (CBlock &block, const CBlockIndex *pindexPrev, const Consensus::Params &consensusParams) |
| Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks). More... | |
| CBlockIndex * | LookupBlockIndex (const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| CBlockIndex * | FindForkInGlobalIndex (const CChain &chain, const CBlockLocator &locator) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| Find the last common block between the parameter chain and a locator. More... | |
| bool | PreciousBlock (BlockValidationState &state, const CChainParams ¶ms, CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main) |
| Mark a block as precious and reorganize. More... | |
| bool | InvalidateBlock (BlockValidationState &state, const CChainParams &chainparams, CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main) |
| Mark a block as invalid. More... | |
| void | ResetBlockFailureFlags (CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| Remove invalidity status from a block and its descendants. More... | |
| ChainstateManager g_chainman | GUARDED_BY (::cs_main) |
| DEPRECATED! Please use node.chainman instead. More... | |
| CChainState & | ChainstateActive () |
| Please prefer the identical ChainstateManager::ActiveChainstate. More... | |
| CChain & | ChainActive () |
| Please prefer the identical ChainstateManager::ActiveChain. More... | |
| int | GetSpendHeight (const CCoinsViewCache &inputs) |
| Return the spend height, which is one more than the inputs.GetBestBlock(). More... | |
| int32_t | ComputeBlockVersion (const CBlockIndex *pindexPrev, const Consensus::Params ¶ms) |
| Determine what nVersion a new block should use. More... | |
| CBlockFileInfo * | GetBlockFileInfo (size_t n) |
| Get block file info entry for one block file. More... | |
| bool | DumpMempool (const CTxMemPool &pool) |
| Dump the mempool to disk. More... | |
| bool | LoadMempool (CTxMemPool &pool) |
| Load the mempool from disk. More... | |
| bool | IsBlockPruned (const CBlockIndex *pblockindex) |
| Check whether the block associated with this index entry is pruned or not. More... | |
Variables | |
| static const unsigned int | DEFAULT_MIN_RELAY_TX_FEE = 1000 |
| Default for -minrelaytxfee, minimum relay fee for transactions. More... | |
| static const unsigned int | DEFAULT_ANCESTOR_LIMIT = 25 |
| Default for -limitancestorcount, max number of in-mempool ancestors. More... | |
| static const unsigned int | DEFAULT_ANCESTOR_SIZE_LIMIT = 101 |
| Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors. More... | |
| static const unsigned int | DEFAULT_DESCENDANT_LIMIT = 25 |
| Default for -limitdescendantcount, max number of in-mempool descendants. More... | |
| static const unsigned int | DEFAULT_DESCENDANT_SIZE_LIMIT = 101 |
| Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants. More... | |
| static const unsigned int | DEFAULT_MEMPOOL_EXPIRY = 336 |
| Default for -mempoolexpiry, expiration time for mempool transactions in hours. More... | |
| static const unsigned int | MAX_BLOCKFILE_SIZE = 0x8000000 |
| The maximum size of a blk?????.dat file (since 0.8) More... | |
| static const int | MAX_SCRIPTCHECK_THREADS = 15 |
| Maximum number of dedicated script-checking threads allowed. More... | |
| static const int | DEFAULT_SCRIPTCHECK_THREADS = 0 |
| -par default (number of script-checking threads, 0 = auto) More... | |
| static const int64_t | DEFAULT_MAX_TIP_AGE = 24 * 60 * 60 |
| static const bool | DEFAULT_CHECKPOINTS_ENABLED = true |
| static const bool | DEFAULT_TXINDEX = false |
| static const char *const | DEFAULT_BLOCKFILTERINDEX = "0" |
| static const bool | DEFAULT_PERSIST_MEMPOOL = true |
| Default for -persistmempool. More... | |
| static const bool | DEFAULT_FEEFILTER = true |
| Default for using fee filter. More... | |
| static const int | DEFAULT_STOPATHEIGHT = 0 |
| Default for -stopatheight. More... | |
| static const unsigned int | MIN_BLOCKS_TO_KEEP = 288 |
| Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ChainActive().Tip() will not be pruned. More... | |
| static const signed int | DEFAULT_CHECKBLOCKS = 6 |
| static const unsigned int | DEFAULT_CHECKLEVEL = 3 |
| static const uint64_t | MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024 |
| RecursiveMutex | cs_main |
| Mutex to guard access to validation specific variables, such as reading or changing the chainstate. More... | |
| CBlockPolicyEstimator | feeEstimator |
| Mutex | g_best_block_mutex |
| std::condition_variable | g_best_block_cv |
| uint256 | g_best_block |
| std::atomic_bool | fImporting |
| std::atomic_bool | fReindex |
| bool | g_parallel_script_checks |
| Whether there are dedicated script-checking threads running. More... | |
| bool | fRequireStandard |
| bool | fCheckBlockIndex |
| bool | fCheckpointsEnabled |
| CFeeRate | minRelayTxFee |
| A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) More... | |
| int64_t | nMaxTipAge |
| If the tip is older than this (in seconds), the node is considered to be in initial block download. More... | |
| uint256 | hashAssumeValid |
| Block hash whose ancestors we will assume to have valid scripts without checking them. More... | |
| arith_uint256 | nMinimumChainWork |
| Minimum work we will assume exists on some valid chain. More... | |
| CBlockIndex * | pindexBestHeader |
| Best header we've seen so far (used for getheaders queries' starting points). More... | |
| bool | fHavePruned |
| Pruning-related variables and constants. More... | |
| bool | fPruneMode |
| True if we're running in -prune mode. More... | |
| uint64_t | nPruneTarget |
| Number of MiB of block files that we're trying to stay below. More... | |
| const std::vector< std::string > | CHECKLEVEL_DOC |
| Documentation for argument 'checklevel'. More... | |
| std::unique_ptr< CBlockTreeDB > | pblocktree |
| Global variable that points to the active block tree (protected by cs_main) More... | |
| VersionBitsCache | versionbitscache |
| typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap |
Definition at line 114 of file validation.h.
|
strong |
| Enumerator | |
|---|---|
| CRITICAL |
The coins cache is in immediate need of a flush. |
| LARGE |
The cache is at >= 90% capacity. |
| OK | |
Definition at line 483 of file validation.h.
| enum DisconnectResult |
| Enumerator | |
|---|---|
| DISCONNECT_OK | |
| DISCONNECT_UNCLEAN | |
| DISCONNECT_FAILED | |
Definition at line 326 of file validation.h.
|
strong |
| Enumerator | |
|---|---|
| NONE | |
| IF_NEEDED | |
| PERIODIC | |
| ALWAYS | |
Definition at line 336 of file validation.h.
|
strong |
Current sync state passed to tip changed callbacks.
| Enumerator | |
|---|---|
| INIT_REINDEX | |
| INIT_DOWNLOAD | |
| POST_INIT | |
Definition at line 106 of file validation.h.
| bool AcceptToMemoryPool | ( | CTxMemPool & | pool, |
| TxValidationState & | state, | ||
| const CTransactionRef & | tx, | ||
| std::list< CTransactionRef > * | plTxnReplaced, | ||
| bool | bypass_limits, | ||
| bool | test_accept = false, |
||
| CAmount * | fee_out = nullptr |
||
| ) |
(try to) add transaction to memory pool plTxnReplaced will be appended to with all transactions replaced from mempool
| [out] | fee_out | optional argument to return tx fee to the caller |
Definition at line 1084 of file validation.cpp.
| bool ActivateBestChain | ( | BlockValidationState & | state, |
| const CChainParams & | chainparams, | ||
| std::shared_ptr< const CBlock > | pblock = std::shared_ptr< const CBlock >() |
||
| ) |
Find the best known block, and make it the tip of the block chain.
May not be called with cs_main held. May not be called in a validationinterface callback.
Definition at line 2968 of file validation.cpp.
| uint64_t CalculateCurrentUsage | ( | ) |
Calculate the amount of disk space the block & undo files currently use.
Calculate the amount of disk space the block & undo files currently use.
Definition at line 3908 of file validation.cpp.
| CChain& ChainActive | ( | ) |
Please prefer the identical ChainstateManager::ActiveChain.
Definition at line 113 of file validation.cpp.
| CChainState& ChainstateActive | ( | ) |
Please prefer the identical ChainstateManager::ActiveChainstate.
Definition at line 106 of file validation.cpp.
| bool CheckBlock | ( | const CBlock & | block, |
| BlockValidationState & | state, | ||
| const Consensus::Params & | consensusParams, | ||
| bool | fCheckPOW = true, |
||
| bool | fCheckMerkleRoot = true |
||
| ) |
Functions for validating blocks and updating the block tree.
Context-independent validity checks
Definition at line 3350 of file validation.cpp.
| bool CheckFinalTx | ( | const CTransaction & | tx, |
| int | flags = -1 |
||
| ) |
Transaction validation functions.
Check if transaction will be final in the next block to be created.
Calls IsFinalTx() with current block height and appropriate block time.
See consensus/consensus.h for flag definitions.
Definition at line 206 of file validation.cpp.
| int32_t ComputeBlockVersion | ( | const CBlockIndex * | pindexPrev, |
| const Consensus::Params & | params | ||
| ) |
Determine what nVersion a new block should use.
Definition at line 1830 of file validation.cpp.
| bool DumpMempool | ( | const CTxMemPool & | pool | ) |
Dump the mempool to disk.
Definition at line 5141 of file validation.cpp.
| CBlockIndex* FindForkInGlobalIndex | ( | const CChain & | chain, |
| const CBlockLocator & | locator | ||
| ) |
Find the last common block between the parameter chain and a locator.
Definition at line 180 of file validation.cpp.
| std::vector<unsigned char> GenerateCoinbaseCommitment | ( | CBlock & | block, |
| const CBlockIndex * | pindexPrev, | ||
| const Consensus::Params & | consensusParams | ||
| ) |
Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks).
Definition at line 3442 of file validation.cpp.
| CBlockFileInfo* GetBlockFileInfo | ( | size_t | n | ) |
Get block file info entry for one block file.
Definition at line 5021 of file validation.cpp.
| fs::path GetBlockPosFilename | ( | const FlatFilePos & | pos | ) |
Translation to a filesystem path.
Definition at line 4076 of file validation.cpp.
| CAmount GetBlockSubsidy | ( | int | nHeight, |
| const Consensus::Params & | consensusParams | ||
| ) |
| int GetSpendHeight | ( | const CCoinsViewCache & | inputs | ) |
Return the spend height, which is one more than the inputs.GetBestBlock().
While checking, GetBestBlock() refers to the parent block. (protected by cs_main) This is also true for mempool checks.
Definition at line 1470 of file validation.cpp.
| CTransactionRef GetTransaction | ( | const CBlockIndex *const | block_index, |
| const CTxMemPool *const | mempool, | ||
| const uint256 & | hash, | ||
| const Consensus::Params & | consensusParams, | ||
| uint256 & | hashBlock | ||
| ) |
Return transaction from the block at block_index.
If block_index is not provided, fall back to mempool. If mempool is not provided or the tx couldn't be found in mempool, fall back to g_txindex.
| [in] | block_index | The block to read from disk, or nullptr |
| [in] | mempool | If block_index is not provided, look in the mempool, if provided |
| [in] | hash | The txid |
| [in] | consensusParams | The params |
| [out] | hashBlock | The hash of block_index, if the tx was found via block_index |
Definition at line 1092 of file validation.cpp.
| ChainstateManager g_chainman GUARDED_BY | ( | ::cs_main | ) |
DEPRECATED! Please use node.chainman instead.
May only be used in validation.cpp internally
| double GuessVerificationProgress | ( | const ChainTxData & | data, |
| const CBlockIndex * | pindex | ||
| ) |
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
Definition at line 5202 of file validation.cpp.
| void InitScriptExecutionCache | ( | ) |
Initializes the script-execution cache.
Definition at line 1481 of file validation.cpp.
| bool InvalidateBlock | ( | BlockValidationState & | state, |
| const CChainParams & | chainparams, | ||
| CBlockIndex * | pindex | ||
| ) |
Mark a block as invalid.
Definition at line 3140 of file validation.cpp.
|
inline |
Check whether the block associated with this index entry is pruned or not.
Definition at line 979 of file validation.h.
| bool IsWitnessEnabled | ( | const CBlockIndex * | pindexPrev, |
| const Consensus::Params & | params | ||
| ) |
Check whether witness commitments are required for a block, and whether to enforce NULLDUMMY (BIP 147) rules.
Note that transaction witness validation rules are always enforced when P2SH is enforced.
Definition at line 3424 of file validation.cpp.
| void LoadExternalBlockFile | ( | const CChainParams & | chainparams, |
| FILE * | fileIn, | ||
| FlatFilePos * | dbp = nullptr |
||
| ) |
Import blocks from an external file.
Definition at line 4672 of file validation.cpp.
| bool LoadGenesisBlock | ( | const CChainParams & | chainparams | ) |
Ensures we have a genesis block in the block tree, possibly writing one to disk.
Definition at line 4667 of file validation.cpp.
| bool LoadMempool | ( | CTxMemPool & | pool | ) |
Load the mempool from disk.
Definition at line 5048 of file validation.cpp.
| CBlockIndex* LookupBlockIndex | ( | const uint256 & | hash | ) |
Definition at line 173 of file validation.cpp.
| FILE* OpenBlockFile | ( | const FlatFilePos & | pos, |
| bool | fReadOnly = false |
||
| ) |
Open a block file (blk?????.dat)
Definition at line 4067 of file validation.cpp.
| bool PreciousBlock | ( | BlockValidationState & | state, |
| const CChainParams & | params, | ||
| CBlockIndex * | pindex | ||
| ) |
Mark a block as precious and reorganize.
May not be called in a validationinterface callback.
Definition at line 3000 of file validation.cpp.
| void PruneBlockFilesManual | ( | int | nManualPruneHeight | ) |
Prune block files up to a given height.
Definition at line 3988 of file validation.cpp.
| bool ReadBlockFromDisk | ( | CBlock & | block, |
| const FlatFilePos & | pos, | ||
| const Consensus::Params & | consensusParams | ||
| ) |
Functions for disk access for blocks.
Definition at line 1145 of file validation.cpp.
| bool ReadBlockFromDisk | ( | CBlock & | block, |
| const CBlockIndex * | pindex, | ||
| const Consensus::Params & | consensusParams | ||
| ) |
| bool ReadRawBlockFromDisk | ( | std::vector< uint8_t > & | block, |
| const FlatFilePos & | pos, | ||
| const CMessageHeader::MessageStartChars & | message_start | ||
| ) |
Definition at line 1190 of file validation.cpp.
| bool ReadRawBlockFromDisk | ( | std::vector< uint8_t > & | block, |
| const CBlockIndex * | pindex, | ||
| const CMessageHeader::MessageStartChars & | message_start | ||
| ) |
| void ResetBlockFailureFlags | ( | CBlockIndex * | pindex | ) |
Remove invalidity status from a block and its descendants.
Definition at line 3178 of file validation.cpp.
| bool TestBlockValidity | ( | BlockValidationState & | state, |
| const CChainParams & | chainparams, | ||
| const CBlock & | block, | ||
| CBlockIndex * | pindexPrev, | ||
| bool | fCheckPOW = true, |
||
| bool | fCheckMerkleRoot = true |
||
| ) |
Check a block is completely valid from start to finish (only works on top of our current best block)
Definition at line 3878 of file validation.cpp.
| bool TestLockPointValidity | ( | const LockPoints * | lp | ) |
Test whether the LockPoints height and time are still valid on the current chain.
Definition at line 238 of file validation.cpp.
| void ThreadScriptCheck | ( | int | worker_num | ) |
Run an instance of the script checking thread.
Definition at line 1823 of file validation.cpp.
| bool UndoReadFromDisk | ( | CBlockUndo & | blockundo, |
| const CBlockIndex * | pindex | ||
| ) |
Definition at line 1628 of file validation.cpp.
| void UnlinkPrunedFiles | ( | const std::set< int > & | setFilesToPrune | ) |
Actually unlink the specified files.
Definition at line 3954 of file validation.cpp.
| void UnloadBlockIndex | ( | CTxMemPool * | mempool, |
| ChainstateManager & | chainman | ||
| ) |
Unload database information.
Definition at line 4601 of file validation.cpp.
| void UpdateCoins | ( | const CTransaction & | tx, |
| CCoinsViewCache & | inputs, | ||
| int | nHeight | ||
| ) |
Apply the effects of this transaction on the UTXO set represented by view.
Definition at line 1458 of file validation.cpp.
| void UpdateUncommittedBlockStructures | ( | CBlock & | block, |
| const CBlockIndex * | pindexPrev, | ||
| const Consensus::Params & | consensusParams | ||
| ) |
Update uncommitted block structures (currently: only the witness reserved value).
This is safe for submitted blocks.
Definition at line 3430 of file validation.cpp.
| ThresholdState VersionBitsTipState | ( | const Consensus::Params & | params, |
| Consensus::DeploymentPos | pos | ||
| ) |
Get the BIP9 state for a given deployment at the current tip.
Definition at line 5028 of file validation.cpp.
| int VersionBitsTipStateSinceHeight | ( | const Consensus::Params & | params, |
| Consensus::DeploymentPos | pos | ||
| ) |
Get the block height at which the BIP9 deployment switched into the state for the block building on the current tip.
Definition at line 5040 of file validation.cpp.
| BIP9Stats VersionBitsTipStatistics | ( | const Consensus::Params & | params, |
| Consensus::DeploymentPos | pos | ||
| ) |
Get the numerical statistics for the BIP9 state for a given deployment at the current tip.
Definition at line 5034 of file validation.cpp.
| const std::vector<std::string> CHECKLEVEL_DOC |
Documentation for argument 'checklevel'.
Definition at line 77 of file validation.cpp.
| RecursiveMutex cs_main |
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
This may also need to be locked when updating the transaction pool, e.g. on AcceptToMemoryPool. See CTxMemPool::cs comment for details.
The transaction pool has a separate lock to allow reading from it and the chainstate at the same time.
Definition at line 129 of file validation.cpp.
|
static |
Default for -limitancestorcount, max number of in-mempool ancestors.
Definition at line 58 of file validation.h.
|
static |
Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors.
Definition at line 60 of file validation.h.
|
static |
Definition at line 76 of file validation.h.
|
static |
Definition at line 85 of file validation.h.
|
static |
Definition at line 86 of file validation.h.
|
static |
Definition at line 74 of file validation.h.
|
static |
Default for -limitdescendantcount, max number of in-mempool descendants.
Definition at line 62 of file validation.h.
|
static |
Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants.
Definition at line 64 of file validation.h.
|
static |
Default for using fee filter.
Definition at line 80 of file validation.h.
|
static |
Definition at line 73 of file validation.h.
|
static |
Default for -mempoolexpiry, expiration time for mempool transactions in hours.
Definition at line 66 of file validation.h.
|
static |
Default for -minrelaytxfee, minimum relay fee for transactions.
Definition at line 56 of file validation.h.
|
static |
Default for -persistmempool.
Definition at line 78 of file validation.h.
|
static |
-par default (number of script-checking threads, 0 = auto)
Definition at line 72 of file validation.h.
|
static |
Default for -stopatheight.
Definition at line 82 of file validation.h.
|
static |
Definition at line 75 of file validation.h.
| bool fCheckBlockIndex |
Definition at line 141 of file validation.cpp.
| bool fCheckpointsEnabled |
Definition at line 142 of file validation.cpp.
| CBlockPolicyEstimator feeEstimator |
Definition at line 151 of file validation.cpp.
| bool fHavePruned |
Pruning-related variables and constants.
True if any block files have ever been pruned.
Definition at line 138 of file validation.cpp.
| std::atomic_bool fImporting |
| bool fPruneMode |
True if we're running in -prune mode.
Definition at line 139 of file validation.cpp.
| std::atomic_bool fReindex |
| bool fRequireStandard |
Definition at line 140 of file validation.cpp.
| uint256 g_best_block |
Definition at line 134 of file validation.cpp.
| std::condition_variable g_best_block_cv |
Definition at line 133 of file validation.cpp.
| Mutex g_best_block_mutex |
Definition at line 132 of file validation.cpp.
| bool g_parallel_script_checks |
Whether there are dedicated script-checking threads running.
False indicates all script checking is done on the main threadMessageHandler thread.
Definition at line 135 of file validation.cpp.
| uint256 hashAssumeValid |
Block hash whose ancestors we will assume to have valid scripts without checking them.
Definition at line 146 of file validation.cpp.
|
static |
The maximum size of a blk?????.dat file (since 0.8)
Definition at line 68 of file validation.h.
|
static |
Maximum number of dedicated script-checking threads allowed.
Definition at line 70 of file validation.h.
|
static |
Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ChainActive().Tip() will not be pruned.
Definition at line 84 of file validation.h.
|
static |
Definition at line 95 of file validation.h.
| CFeeRate minRelayTxFee |
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation)
Definition at line 149 of file validation.cpp.
| int64_t nMaxTipAge |
If the tip is older than this (in seconds), the node is considered to be in initial block download.
Definition at line 144 of file validation.cpp.
| arith_uint256 nMinimumChainWork |
Minimum work we will assume exists on some valid chain.
Definition at line 147 of file validation.cpp.
| uint64_t nPruneTarget |
Number of MiB of block files that we're trying to stay below.
Definition at line 143 of file validation.cpp.
| std::unique_ptr<CBlockTreeDB> pblocktree |
Global variable that points to the active block tree (protected by cs_main)
Definition at line 199 of file validation.cpp.
| CBlockIndex* pindexBestHeader |
Best header we've seen so far (used for getheaders queries' starting points).
Definition at line 131 of file validation.cpp.
| VersionBitsCache versionbitscache |
1.8.8