Go to the source code of this file.
|
enum | TxValidationResult {
TxValidationResult::TX_RESULT_UNSET = 0,
TxValidationResult::TX_CONSENSUS,
TxValidationResult::TX_RECENT_CONSENSUS_CHANGE,
TxValidationResult::TX_INPUTS_NOT_STANDARD,
TxValidationResult::TX_NOT_STANDARD,
TxValidationResult::TX_MISSING_INPUTS,
TxValidationResult::TX_PREMATURE_SPEND,
TxValidationResult::TX_WITNESS_MUTATED,
TxValidationResult::TX_WITNESS_STRIPPED,
TxValidationResult::TX_CONFLICT,
TxValidationResult::TX_MEMPOOL_POLICY,
TxValidationResult::TX_NO_MEMPOOL
} |
| A "reason" why a transaction was invalid, suitable for determining whether the provider of the transaction should be banned/ignored/disconnected/etc. More...
|
|
enum | BlockValidationResult {
BlockValidationResult::BLOCK_RESULT_UNSET = 0,
BlockValidationResult::BLOCK_CONSENSUS,
BlockValidationResult::BLOCK_RECENT_CONSENSUS_CHANGE,
BlockValidationResult::BLOCK_CACHED_INVALID,
BlockValidationResult::BLOCK_INVALID_HEADER,
BlockValidationResult::BLOCK_MUTATED,
BlockValidationResult::BLOCK_MISSING_PREV,
BlockValidationResult::BLOCK_INVALID_PREV,
BlockValidationResult::BLOCK_TIME_FUTURE,
BlockValidationResult::BLOCK_CHECKPOINT
} |
| A "reason" why a block was invalid, suitable for determining whether the provider of the block should be banned/ignored/disconnected/etc. More...
|
|
◆ BlockValidationResult
A "reason" why a block was invalid, suitable for determining whether the provider of the block should be banned/ignored/disconnected/etc.
These are much more granular than the rejection codes, which may be more useful for some other use-cases.
Enumerator |
---|
BLOCK_RESULT_UNSET | initial value. Block has not yet been rejected
|
BLOCK_CONSENSUS | invalid by consensus rules (excluding any below reasons)
|
BLOCK_RECENT_CONSENSUS_CHANGE | Invalid by a change to consensus rules more recent than SegWit.
Currently unused as there are no such consensus rule changes, and any download sources realistically need to support SegWit in order to provide useful data, so differentiating between always-invalid and invalid-by-pre-SegWit-soft-fork is uninteresting.
|
BLOCK_CACHED_INVALID | this block was cached as being invalid and we didn't store the reason why
|
BLOCK_INVALID_HEADER | invalid proof of work or time too old
|
BLOCK_MUTATED | the block's data didn't match the data committed to by the PoW
|
BLOCK_MISSING_PREV | We don't have the previous block the checked one is built on.
|
BLOCK_INVALID_PREV | A block this one builds on is invalid.
|
BLOCK_TIME_FUTURE | block timestamp was > 2 hours in the future (or our clock is bad)
|
BLOCK_CHECKPOINT | the block failed to meet one of our checkpoints
|
Definition at line 64 of file validation.h.
◆ TxValidationResult
A "reason" why a transaction was invalid, suitable for determining whether the provider of the transaction should be banned/ignored/disconnected/etc.
Enumerator |
---|
TX_RESULT_UNSET | initial value. Tx has not yet been rejected
|
TX_CONSENSUS | invalid by consensus rules
|
TX_RECENT_CONSENSUS_CHANGE | Invalid by a change to consensus rules more recent than SegWit.
Currently unused as there are no such consensus rule changes, and any download sources realistically need to support SegWit in order to provide useful data, so differentiating between always-invalid and invalid-by-pre-SegWit-soft-fork is uninteresting.
|
TX_INPUTS_NOT_STANDARD | inputs (covered by txid) failed policy rules
|
TX_NOT_STANDARD | otherwise didn't meet our local policy rules
|
TX_MISSING_INPUTS | transaction was missing some of its inputs
|
TX_PREMATURE_SPEND | transaction spends a coinbase too early, or violates locktime/sequence locks
|
TX_WITNESS_MUTATED | Transaction might have a witness prior to SegWit activation, or witness may have been malleated (which includes non-standard witnesses).
|
TX_WITNESS_STRIPPED | Transaction is missing a witness.
|
TX_CONFLICT | Tx already in mempool or conflicts with a tx in the chain (if it conflicts with another tx in mempool, we use MEMPOOL_POLICY as it failed to reach the RBF threshold) Currently this is only used if the transaction already exists in the mempool or on chain.
|
TX_MEMPOOL_POLICY | violated mempool's fee/size/descendant/RBF/etc limits
|
TX_NO_MEMPOOL | this node does not have a mempool so can't validate the transaction
|
Definition at line 24 of file validation.h.
◆ GetBlockWeight()
static int64_t GetBlockWeight |
( |
const CBlock & |
block | ) |
|
|
inlinestatic |
◆ GetTransactionInputWeight()
static int64_t GetTransactionInputWeight |
( |
const CTxIn & |
txin | ) |
|
|
inlinestatic |
◆ GetTransactionWeight()
static int64_t GetTransactionWeight |
( |
const CTransaction & |
tx | ) |
|
|
inlinestatic |
◆ GetWitnessCommitmentIndex()
int GetWitnessCommitmentIndex |
( |
const CBlock & |
block | ) |
|
|
inline |
Compute at which vout of the block's coinbase transaction the witness commitment occurs, or -1 if not found.
Definition at line 162 of file validation.h.
◆ MINIMUM_WITNESS_COMMITMENT
constexpr size_t MINIMUM_WITNESS_COMMITMENT {38} |
|
staticconstexpr |
Minimum size of a witness commitment structure.
Defined in BIP 141.
Definition at line 19 of file validation.h.
◆ NO_WITNESS_COMMITMENT
constexpr int NO_WITNESS_COMMITMENT {-1} |
|
staticconstexpr |
Index marker for when no witness commitment is present in a coinbase transaction.
Definition at line 16 of file validation.h.