![]() |
Bitcoin Core 22.99.0
P2P Digital Currency
|
#include <validation.h>
#include <arith_uint256.h>
#include <chain.h>
#include <chainparams.h>
#include <checkqueue.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/merkle.h>
#include <consensus/tx_check.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
#include <cuckoocache.h>
#include <deploymentstatus.h>
#include <flatfile.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <logging.h>
#include <logging/timer.h>
#include <node/blockstorage.h>
#include <node/coinstats.h>
#include <node/ui_interface.h>
#include <node/utxo_snapshot.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <policy/settings.h>
#include <pow.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <random.h>
#include <reverse_iterator.h>
#include <script/script.h>
#include <script/sigcache.h>
#include <shutdown.h>
#include <signet.h>
#include <timedata.h>
#include <tinyformat.h>
#include <txdb.h>
#include <txmempool.h>
#include <uint256.h>
#include <undo.h>
#include <util/check.h>
#include <util/hasher.h>
#include <util/moneystr.h>
#include <util/rbf.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/trace.h>
#include <util/translation.h>
#include <validationinterface.h>
#include <warnings.h>
#include <numeric>
#include <optional>
#include <string>
#include <boost/algorithm/string/replace.hpp>
Go to the source code of this file.
Classes | |
class | WarningBitsConditionChecker |
Threshold condition checker that triggers when unknown versionbits are seen on the network. More... | |
struct | PerBlockConnectTrace |
class | ConnectTrace |
Used to track blocks whose transactions were applied to the UTXO state as a part of a single ActivateBestChainStep call. More... | |
Macros | |
#define | MICRO 0.000001 |
#define | MILLI 0.001 |
Functions | |
void | FlushBlockFile (bool fFinalize=false, bool finalize_undo=false) |
bool | CheckInputScripts (const CTransaction &tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData &txdata, std::vector< CScriptCheck > *pvChecks) |
Check whether all of this transaction's input scripts succeed. More... | |
bool | CheckFinalTx (const CBlockIndex *active_chain_tip, const CTransaction &tx, int flags) |
Transaction validation functions. More... | |
bool | TestLockPointValidity (CChain &active_chain, const LockPoints *lp) |
Test whether the LockPoints height and time are still valid on the current chain. More... | |
bool | CheckSequenceLocks (CBlockIndex *tip, const CCoinsView &coins_view, const CTransaction &tx, int flags, LockPoints *lp, bool useExistingLockPoints) |
Check if transaction will be BIP68 final in the next block to be created on top of tip. More... | |
static unsigned int | GetBlockScriptFlags (const CBlockIndex *pindex, const Consensus::Params &chainparams) |
static void | LimitMempoolSize (CTxMemPool &pool, CCoinsViewCache &coins_cache, size_t limit, std::chrono::seconds age) EXCLUSIVE_LOCKS_REQUIRED(pool.cs |
if (expired !=0) | |
pool | TrimToSize (limit, &vNoSpendsRemaining) |
for (const COutPoint &removed :vNoSpendsRemaining) coins_cache.Uncache(removed) | |
static bool | IsCurrentForFeeEstimation (CChainState &active_chainstate) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
static bool | CheckInputsFromMempoolAndCache (const CTransaction &tx, TxValidationState &state, const CCoinsViewCache &view, const CTxMemPool &pool, unsigned int flags, PrecomputedTransactionData &txdata, CCoinsViewCache &coins_tip) EXCLUSIVE_LOCKS_REQUIRED(cs_main |
Checks to avoid mempool polluting consensus critical paths since cached signature and script validity results will be reused if we validate this transaction again during block validation. More... | |
AssertLockHeld (pool.cs) | |
assert (!tx.IsCoinBase()) | |
for (const CTxIn &txin :tx.vin) | |
return | CheckInputScripts (tx, state, view, flags, true, true, txdata) |
static MempoolAcceptResult | AcceptToMemoryPoolWithTime (const CChainParams &chainparams, CTxMemPool &pool, CChainState &active_chainstate, const CTransactionRef &tx, int64_t nAcceptTime, bool bypass_limits, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
(try to) add transaction to memory pool with a specified acceptance time More... | |
MempoolAcceptResult | AcceptToMemoryPool (CChainState &active_chainstate, CTxMemPool &pool, const CTransactionRef &tx, bool bypass_limits, bool test_accept) |
(Try to) add a transaction to the memory pool. More... | |
PackageMempoolAcceptResult | ProcessNewPackage (CChainState &active_chainstate, CTxMemPool &pool, const Package &package, bool test_accept) |
Atomically test acceptance of a package. More... | |
CAmount | GetBlockSubsidy (int nHeight, const Consensus::Params &consensusParams) |
static void | AlertNotify (const std::string &strMessage) |
void | UpdateCoins (const CTransaction &tx, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight) |
void | InitScriptExecutionCache () |
Initializes the script-execution cache. More... | |
bool | AbortNode (BlockValidationState &state, const std::string &strMessage, const bilingual_str &userMessage) |
int | ApplyTxInUndo (Coin &&undo, CCoinsViewCache &view, const COutPoint &out) |
Restore the UTXO in a Coin at a given COutPoint. More... | |
void | StartScriptCheckWorkerThreads (int threads_num) |
Run instances of script checking worker threads. More... | |
void | StopScriptCheckWorkerThreads () |
Stop all of the script checking worker threads. More... | |
static ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS] | GUARDED_BY (cs_main) |
static void | DoWarning (const bilingual_str &warning) |
static void | AppendWarning (bilingual_str &res, const bilingual_str &warn) |
Private helper function that concatenates warning messages. More... | |
static void | UpdateTipLog (const CCoinsViewCache &coins_tip, const CBlockIndex *tip, const CChainParams ¶ms, const std::string &func_name, const std::string &prefix, const std::string &warning_messages) EXCLUSIVE_LOCKS_REQUIRED( |
static SynchronizationState | GetSynchronizationState (bool init) |
static bool | NotifyHeaderTip (CChainState &chainstate) LOCKS_EXCLUDED(cs_main) |
static void | LimitValidationInterfaceQueue () LOCKS_EXCLUDED(cs_main) |
static bool | CheckBlockHeader (const CBlockHeader &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW=true) |
bool | CheckBlock (const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW, bool fCheckMerkleRoot) |
Functions for validating blocks and updating the block tree. 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... | |
static bool | ContextualCheckBlockHeader (const CBlockHeader &block, BlockValidationState &state, BlockManager &blockman, const CChainParams ¶ms, const CBlockIndex *pindexPrev, int64_t nAdjustedTime) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
Context-dependent validity checks. More... | |
static bool | ContextualCheckBlock (const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, const CBlockIndex *pindexPrev) |
NOTE: This function is not currently invoked by ConnectBlock(), so we should consider upgrade issues if we change which consensus rules are enforced in this function (eg by adding a new consensus rule). More... | |
bool | TestBlockValidity (BlockValidationState &state, const CChainParams &chainparams, CChainState &chainstate, const CBlock &block, CBlockIndex *pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot) |
Check a block is completely valid from start to finish (only works on top of our current best block) More... | |
void | PruneBlockFilesManual (CChainState &active_chainstate, int nManualPruneHeight) |
Prune block files up to a given height. More... | |
void | UnloadBlockIndex (CTxMemPool *mempool, ChainstateManager &chainman) |
Unload database information. More... | |
bool | LoadMempool (CTxMemPool &pool, CChainState &active_chainstate, FopenFn mockable_fopen_function) |
Load the mempool from disk. More... | |
bool | DumpMempool (const CTxMemPool &pool, FopenFn mockable_fopen_function, bool skip_file_commit) |
Dump the mempool to disk. More... | |
double | GuessVerificationProgress (const ChainTxData &data, const CBlockIndex *pindex) |
Guess how far we are in the verification process at the given block index require cs_main if pindex has not been validated yet (because nChainTx might be unset) More... | |
const AssumeutxoData * | ExpectedAssumeutxo (const int height, const CChainParams &chainparams) |
Return the expected assumeutxo value for a given height, if one exists. More... | |
Variables | |
static const unsigned int | EXTRA_DESCENDANT_TX_SIZE_LIMIT = 10000 |
An extra transaction can be added to a package, as long as it only has one ancestor and is no larger than this. More... | |
static const unsigned int | MAX_DISCONNECTED_TX_POOL_SIZE = 20000 |
Maximum kilobytes for transactions to store for processing during reorg. More... | |
static constexpr std::chrono::hours | DATABASE_WRITE_INTERVAL {1} |
Time to wait between writing blocks/block index to disk. More... | |
static constexpr std::chrono::hours | DATABASE_FLUSH_INTERVAL {24} |
Time to wait between flushing chainstate to disk. More... | |
static constexpr std::chrono::hours | MAX_FEE_ESTIMATION_TIP_AGE {3} |
Maximum age of our tip for us to be considered current for fee estimation. More... | |
const std::vector< std::string > | CHECKLEVEL_DOC |
Documentation for argument 'checklevel'. More... | |
RecursiveMutex | cs_main |
Mutex to guard access to validation specific variables, such as reading or changing the chainstate. More... | |
CBlockIndex * | pindexBestHeader = nullptr |
Best header we've seen so far (used for getheaders queries' starting points). More... | |
Mutex | g_best_block_mutex |
std::condition_variable | g_best_block_cv |
uint256 | g_best_block |
Used to notify getblocktemplate RPC of new tips. More... | |
bool | g_parallel_script_checks {false} |
Whether there are dedicated script-checking threads running. More... | |
bool | fRequireStandard = true |
bool | fCheckBlockIndex = false |
bool | fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED |
int64_t | nMaxTipAge = DEFAULT_MAX_TIP_AGE |
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... | |
CFeeRate | minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE) |
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) More... | |
RecursiveMutex | cs_LastBlockFile |
std::vector< CBlockFileInfo > | vinfoBlockFile |
int | nLastBlockFile |
bool | fCheckForPruning |
Global flag to indicate we should check to see if there are block/undo files that should be deleted. More... | |
std::set< CBlockIndex * > | setDirtyBlockIndex |
Dirty block index entries. More... | |
std::set< int > | setDirtyFileInfo |
Dirty block file entries. More... | |
std::vector< COutPoint > | vNoSpendsRemaining |
static bool pool | cs |
static CuckooCache::cache< uint256, SignatureCacheHasher > | g_scriptExecutionCache |
static CSHA256 | g_scriptExecutionCacheHasher |
static CCheckQueue< CScriptCheck > | scriptcheckqueue (128) |
static int64_t | nTimeCheck = 0 |
static int64_t | nTimeForks = 0 |
static int64_t | nTimeVerify = 0 |
static int64_t | nTimeConnect = 0 |
static int64_t | nTimeIndex = 0 |
static int64_t | nTimeTotal = 0 |
static int64_t | nBlocksTotal = 0 |
static int64_t | nTimeReadFromDisk = 0 |
static int64_t | nTimeConnectTotal = 0 |
static int64_t | nTimeFlush = 0 |
static int64_t | nTimeChainState = 0 |
static int64_t | nTimePostConnect = 0 |
static const uint64_t | MEMPOOL_DUMP_VERSION = 1 |
#define MICRO 0.000001 |
Definition at line 64 of file validation.cpp.
#define MILLI 0.001 |
Definition at line 65 of file validation.cpp.
bool AbortNode | ( | BlockValidationState & | state, |
const std::string & | strMessage, | ||
const bilingual_str & | userMessage | ||
) |
Definition at line 1379 of file validation.cpp.
MempoolAcceptResult AcceptToMemoryPool | ( | CChainState & | active_chainstate, |
CTxMemPool & | pool, | ||
const CTransactionRef & | tx, | ||
bool | bypass_limits, | ||
bool | test_accept = false |
||
) |
(Try to) add a transaction to the memory pool.
[in] | bypass_limits | When true, don't enforce mempool fee limits. |
[in] | test_accept | When true, run validation checks but don't submit to mempool. |
Definition at line 1041 of file validation.cpp.
|
static |
(try to) add transaction to memory pool with a specified acceptance time
Definition at line 1015 of file validation.cpp.
|
static |
Definition at line 1153 of file validation.cpp.
|
static |
Private helper function that concatenates warning messages.
Definition at line 2081 of file validation.cpp.
int ApplyTxInUndo | ( | Coin && | undo, |
CCoinsViewCache & | view, | ||
const COutPoint & | out | ||
) |
Restore the UTXO in a Coin at a given COutPoint.
undo | The Coin to be restored. |
view | The coins view to which to apply the changes. |
out | The out point that corresponds to the tx input. |
Definition at line 1392 of file validation.cpp.
assert | ( | !tx. | IsCoinBase() | ) |
AssertLockHeld | ( | pool. | cs | ) |
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 2922 of file validation.cpp.
|
static |
Definition at line 2913 of file validation.cpp.
bool CheckFinalTx | ( | const CBlockIndex * | active_chain_tip, |
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 182 of file validation.cpp.
bool CheckInputScripts | ( | const CTransaction & | tx, |
TxValidationState & | state, | ||
const CCoinsViewCache & | inputs, | ||
unsigned int | flags, | ||
bool | cacheSigStore, | ||
bool | cacheFullScriptStore, | ||
PrecomputedTransactionData & | txdata, | ||
std::vector< CScriptCheck > * | pvChecks | ||
) |
Check whether all of this transaction's input scripts succeed.
This involves ECDSA signature checks so can be computationally intensive. This function should only be called after the cheap sanity checks in CheckTxInputs passed.
If pvChecks is not nullptr, script checks are pushed onto it instead of being performed inline. Any script checks which are not necessary (eg due to script execution cache hits) are, obviously, not pushed onto pvChecks/run.
Setting cacheSigStore/cacheFullScriptStore to false will remove elements from the corresponding cache which are matched. This is useful for checking blocks where we will likely never need the cache entry again.
Note that we may set state.reason to NOT_STANDARD for extra soft-fork flags in flags, block-checking callers should probably reset it to CONSENSUS in such cases.
Non-static (and re-declared) in src/test/txvalidationcache_tests.cpp
Definition at line 1291 of file validation.cpp.
return CheckInputScripts | ( | tx | , |
state | , | ||
view | , | ||
flags | , | ||
true | , | ||
true | , | ||
txdata | |||
) |
|
static |
Checks to avoid mempool polluting consensus critical paths since cached signature and script validity results will be reused if we validate this transaction again during block validation.
bool CheckSequenceLocks | ( | CBlockIndex * | tip, |
const CCoinsView & | coins_view, | ||
const CTransaction & | tx, | ||
int | flags, | ||
LockPoints * | lp = nullptr , |
||
bool | useExistingLockPoints = false |
||
) |
Check if transaction will be BIP68 final in the next block to be created on top of tip.
[in] | tip | Chain tip to check tx sequence locks against. For example, the tip of the current active chain. |
[in] | coins_view | Any CCoinsView that provides access to the relevant coins for checking sequence locks. For example, it can be a CCoinsViewCache that isn't connected to anything but contains all the relevant coins, or a CCoinsViewMemPool that is connected to the mempool and chainstate UTXO set. In the latter case, the caller is responsible for holding the appropriate locks to ensure that calls to GetCoin() return correct coins. Simulates calling SequenceLocks() with data from the tip passed in. Optionally stores in LockPoints the resulting height and time calculated and the hash of the block needed for calculation or skips the calculation and uses the LockPoints passed in for evaluation. The LockPoints should not be considered valid if CheckSequenceLocks returns false. |
See consensus/consensus.h for flag definitions.
Definition at line 233 of file validation.cpp.
|
static |
NOTE: This function is not currently invoked by ConnectBlock(), so we should consider upgrade issues if we change which consensus rules are enforced in this function (eg by adding a new consensus rule).
See comment in ConnectBlock(). Note that -reindex-chainstate skips the validation that happens here!
Definition at line 3106 of file validation.cpp.
|
static |
Context-dependent validity checks.
By "context", we mean only the previous block headers, but not the UTXO set; UTXO-related validity checks are done in ConnectBlock(). NOTE: This function is not currently invoked by ConnectBlock(), so we should consider upgrade issues if we change which consensus rules are enforced in this function (eg by adding a new consensus rule). See comment in ConnectBlock(). Note that -reindex-chainstate skips the validation that happens here!
Definition at line 3059 of file validation.cpp.
|
static |
bool DumpMempool | ( | const CTxMemPool & | pool, |
FopenFn | mockable_fopen_function, | ||
bool | skip_file_commit | ||
) |
Dump the mempool to disk.
Definition at line 4533 of file validation.cpp.
const AssumeutxoData * ExpectedAssumeutxo | ( | const int | height, |
const CChainParams & | params | ||
) |
Return the expected assumeutxo value for a given height, if one exists.
[in] | height | Get the assumeutxo value for this height. |
Definition at line 4662 of file validation.cpp.
void FlushBlockFile | ( | bool | fFinalize = false , |
bool | finalize_undo = false |
||
) |
Definition at line 179 of file blockstorage.cpp.
for | ( | const COutPoint &removed :vNoSpendsRemaining | ) |
for | ( | const CTxIn &txin :tx. | vin | ) |
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 3008 of file validation.cpp.
|
static |
Definition at line 1518 of file validation.cpp.
CAmount GetBlockSubsidy | ( | int | nHeight, |
const Consensus::Params & | consensusParams | ||
) |
|
static |
|
static |
double GuessVerificationProgress | ( | const ChainTxData & | data, |
const CBlockIndex * | pindex | ||
) |
Guess how far we are in the verification process at the given block index require cs_main if pindex has not been validated yet (because nChainTx might be unset)
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
Definition at line 4596 of file validation.cpp.
if | ( | expired ! | = 0 | ) |
void InitScriptExecutionCache | ( | ) |
Initializes the script-execution cache.
Definition at line 1256 of file validation.cpp.
|
static |
|
static |
|
static |
Definition at line 2520 of file validation.cpp.
bool LoadMempool | ( | CTxMemPool & | pool, |
CChainState & | active_chainstate, | ||
FopenFn | mockable_fopen_function | ||
) |
Load the mempool from disk.
Definition at line 4449 of file validation.cpp.
|
static |
Definition at line 2498 of file validation.cpp.
PackageMempoolAcceptResult ProcessNewPackage | ( | CChainState & | active_chainstate, |
CTxMemPool & | pool, | ||
const Package & | txns, | ||
bool | test_accept | ||
) |
Atomically test acceptance of a package.
If the package only contains one tx, package rules still apply. Package validation does not allow BIP125 replacements, so the transaction(s) cannot spend the same inputs as any transaction in the mempool.
[in] | txns | Group of transactions which may be independent or contain parent-child dependencies. The transactions must not conflict with each other, i.e., must not spend the same inputs. If any dependencies exist, parents must appear anywhere in the list before their children. |
Definition at line 1047 of file validation.cpp.
void PruneBlockFilesManual | ( | CChainState & | active_chainstate, |
int | nManualPruneHeight | ||
) |
Prune block files up to a given height.
Definition at line 3520 of file validation.cpp.
void StartScriptCheckWorkerThreads | ( | int | threads_num | ) |
Run instances of script checking worker threads.
Definition at line 1481 of file validation.cpp.
void StopScriptCheckWorkerThreads | ( | ) |
Stop all of the script checking worker threads.
Definition at line 1486 of file validation.cpp.
bool TestBlockValidity | ( | BlockValidationState & | state, |
const CChainParams & | chainparams, | ||
CChainState & | chainstate, | ||
const CBlock & | block, | ||
CBlockIndex * | pindexPrev, | ||
bool | fCheckPOW, | ||
bool | fCheckMerkleRoot | ||
) |
Check a block is completely valid from start to finish (only works on top of our current best block)
Definition at line 3426 of file validation.cpp.
bool TestLockPointValidity | ( | CChain & | active_chain, |
const LockPoints * | lp | ||
) |
Test whether the LockPoints height and time are still valid on the current chain.
Definition at line 215 of file validation.cpp.
pool TrimToSize | ( | limit | , |
& | vNoSpendsRemaining | ||
) |
void UnloadBlockIndex | ( | CTxMemPool * | mempool, |
ChainstateManager & | chainman | ||
) |
Unload database information.
Definition at line 4002 of file validation.cpp.
void UpdateCoins | ( | const CTransaction & | tx, |
CCoinsViewCache & | inputs, | ||
CTxUndo & | txundo, | ||
int | nHeight | ||
) |
Definition at line 1224 of file validation.cpp.
|
static |
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 2996 of file validation.cpp.
const std::vector<std::string> CHECKLEVEL_DOC |
Documentation for argument 'checklevel'.
Definition at line 81 of file validation.cpp.
bool pool cs |
Definition at line 389 of file validation.cpp.
|
extern |
Definition at line 30 of file blockstorage.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 118 of file validation.cpp.
|
staticconstexpr |
Time to wait between flushing chainstate to disk.
Definition at line 78 of file validation.cpp.
|
staticconstexpr |
Time to wait between writing blocks/block index to disk.
Definition at line 76 of file validation.cpp.
|
static |
An extra transaction can be added to a package, as long as it only has one ancestor and is no larger than this.
Not really any reason to make this configurable as it doesn't materially change DoS parameters.
Definition at line 72 of file validation.cpp.
bool fCheckBlockIndex = false |
Definition at line 126 of file validation.cpp.
|
extern |
Global flag to indicate we should check to see if there are block/undo files that should be deleted.
Set on startup or if we allocate more file space when we're in prune mode
Definition at line 37 of file blockstorage.cpp.
bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED |
Definition at line 127 of file validation.cpp.
bool fRequireStandard = true |
Definition at line 125 of file validation.cpp.
uint256 g_best_block |
Used to notify getblocktemplate RPC of new tips.
Definition at line 123 of file validation.cpp.
std::condition_variable g_best_block_cv |
Definition at line 122 of file validation.cpp.
Mutex g_best_block_mutex |
Definition at line 121 of file validation.cpp.
bool g_parallel_script_checks {false} |
Whether there are dedicated script-checking threads running.
False indicates all script checking is done on the main threadMessageHandler thread.
Definition at line 124 of file validation.cpp.
|
static |
Definition at line 1253 of file validation.cpp.
|
static |
Definition at line 1254 of file validation.cpp.
uint256 hashAssumeValid |
Block hash whose ancestors we will assume to have valid scripts without checking them.
Definition at line 130 of file validation.cpp.
|
static |
Maximum kilobytes for transactions to store for processing during reorg.
Definition at line 74 of file validation.cpp.
|
staticconstexpr |
Maximum age of our tip for us to be considered current for fee estimation.
Definition at line 80 of file validation.cpp.
|
static |
Definition at line 4447 of file validation.cpp.
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE) |
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation)
Definition at line 133 of file validation.cpp.
|
static |
Definition at line 1571 of file validation.cpp.
|
extern |
Definition at line 32 of file blockstorage.cpp.
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE |
If the tip is older than this (in seconds), the node is considered to be in initial block download.
Definition at line 128 of file validation.cpp.
arith_uint256 nMinimumChainWork |
Minimum work we will assume exists on some valid chain.
Definition at line 131 of file validation.cpp.
|
static |
Definition at line 2217 of file validation.cpp.
|
static |
Definition at line 1565 of file validation.cpp.
|
static |
Definition at line 1568 of file validation.cpp.
|
static |
Definition at line 2215 of file validation.cpp.
|
static |
Definition at line 2216 of file validation.cpp.
|
static |
Definition at line 1566 of file validation.cpp.
|
static |
Definition at line 1569 of file validation.cpp.
|
static |
Definition at line 2218 of file validation.cpp.
|
static |
Definition at line 2214 of file validation.cpp.
|
static |
Definition at line 1570 of file validation.cpp.
|
static |
Definition at line 1567 of file validation.cpp.
CBlockIndex* pindexBestHeader = nullptr |
Best header we've seen so far (used for getheaders queries' starting points).
Definition at line 120 of file validation.cpp.
|
static |
|
extern |
Dirty block index entries.
Definition at line 40 of file blockstorage.cpp.
|
extern |
Dirty block file entries.
Definition at line 43 of file blockstorage.cpp.
|
extern |
Definition at line 31 of file blockstorage.cpp.
std::vector<COutPoint> vNoSpendsRemaining |
Definition at line 315 of file validation.cpp.