Bitcoin ABC  0.26.3
P2P Digital Currency
Classes | Enumerations
validation.h File Reference
#include <cassert>
#include <string>
Include dependency graph for validation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ValidationState< Result >
 Template for capturing information about block/transaction validation. More...
 
class  TxValidationState
 
class  BlockValidationState
 

Enumerations

enum class  TxValidationResult {
  TX_RESULT_UNSET = 0 , TX_CONSENSUS , TX_RECENT_CONSENSUS_CHANGE , TX_INPUTS_NOT_STANDARD ,
  TX_NOT_STANDARD , TX_MISSING_INPUTS , TX_PREMATURE_SPEND , TX_CONFLICT ,
  TX_MEMPOOL_POLICY , 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 class  BlockValidationResult {
  BLOCK_RESULT_UNSET = 0 , BLOCK_CONSENSUS , BLOCK_RECENT_CONSENSUS_CHANGE , BLOCK_CACHED_INVALID ,
  BLOCK_INVALID_HEADER , BLOCK_MUTATED , BLOCK_MISSING_PREV , BLOCK_INVALID_PREV ,
  BLOCK_TIME_FUTURE , BLOCK_CHECKPOINT , BLOCK_FINALIZATION
}
 A "reason" why a block was invalid, suitable for determining whether the provider of the block should be banned/ignored/disconnected/etc. More...
 

Enumeration Type Documentation

◆ BlockValidationResult

enum BlockValidationResult
strong

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

BLOCK_FINALIZATION 

block finalization problems

Definition at line 53 of file validation.h.

◆ TxValidationResult

enum TxValidationResult
strong

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 recent change to consensus rules.

Currently unused as there are no such consensus rule changes.

TX_INPUTS_NOT_STANDARD 

inputs 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_CONFLICT 

Tx already in mempool or conflicts with a tx in the chain 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/etc limits

TX_NO_MEMPOOL 

this node does not have a mempool so can't validate the transaction

Definition at line 16 of file validation.h.