Template for capturing information about block/transaction validation. This is instantiated by TxValidationState and BlockValidationState for validation information on transactions and blocks respectively.

Synopsis

Declared in <consensus/validation.h>

template<typename Result>
class ValidationState;

Member Functions

Name

Description

Error

Puts the state into the run‐time error mode.

GetDebugMessage

Returns the human‐readable debug message.

GetRejectReason

Returns the short rejection reason.

GetResult

Returns the recorded result code.

Invalid

Marks the state invalid and records the reason and debug message.

IsError

Returns true if the state was marked with a run‐time error.

IsInvalid

Returns true if the state was marked invalid by a consensus or policy rule.

IsValid

Returns true if no validation failure has been recorded.

ToString

Formats the state as a human‐readable string.

Derived Classes

Name

Description

BlockValidationState

Captures the outcome of validating a block.

PackageValidationState

Validation state for a package, carrying a PackageValidationResult rejection reason.

TxValidationState

Validation state specialized for transaction‐level results.

Created with MrDocs