Bitcoin Core  0.19.99
P2P Digital Currency
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
ValidationState Class Referenceabstract

Base class for capturing information about block/transaction validation. More...

#include <validation.h>

Inheritance diagram for ValidationState:
[legend]

Public Member Functions

virtual ~ValidationState ()=0
 
 ValidationState ()
 
bool Error (const std::string &reject_reason)
 
bool IsValid () const
 
bool IsInvalid () const
 
bool IsError () const
 
std::string GetRejectReason () const
 
std::string GetDebugMessage () const
 

Protected Member Functions

void Invalid (const std::string &reject_reason="", const std::string &debug_message="")
 

Private Types

enum  mode_state { MODE_VALID, MODE_INVALID, MODE_ERROR }
 

Private Attributes

enum ValidationState::mode_state m_mode
 
std::string m_reject_reason
 
std::string m_debug_message
 

Detailed Description

Base class for capturing information about block/transaction validation.

This is subclassed by TxValidationState and BlockValidationState for validation information on transactions and blocks respectively.

Definition at line 77 of file validation.h.

Member Enumeration Documentation

◆ mode_state

Enumerator
MODE_VALID 

everything ok

MODE_INVALID 

network rule violation (DoS value may be set)

MODE_ERROR 

run-time error

Definition at line 79 of file validation.h.

Constructor & Destructor Documentation

◆ ~ValidationState()

ValidationState::~ValidationState ( )
inlinepure virtual

Definition at line 113 of file validation.h.

◆ ValidationState()

ValidationState::ValidationState ( )
inline

Definition at line 98 of file validation.h.

Member Function Documentation

◆ Error()

bool ValidationState::Error ( const std::string &  reject_reason)
inline

Definition at line 99 of file validation.h.

Here is the caller graph for this function:

◆ GetDebugMessage()

std::string ValidationState::GetDebugMessage ( ) const
inline

Definition at line 110 of file validation.h.

Here is the caller graph for this function:

◆ GetRejectReason()

std::string ValidationState::GetRejectReason ( ) const
inline

Definition at line 109 of file validation.h.

Here is the caller graph for this function:

◆ Invalid()

void ValidationState::Invalid ( const std::string &  reject_reason = "",
const std::string &  debug_message = "" 
)
inlineprotected

Definition at line 87 of file validation.h.

Here is the caller graph for this function:

◆ IsError()

bool ValidationState::IsError ( ) const
inline

Definition at line 108 of file validation.h.

Here is the caller graph for this function:

◆ IsInvalid()

bool ValidationState::IsInvalid ( ) const
inline

Definition at line 107 of file validation.h.

Here is the caller graph for this function:

◆ IsValid()

bool ValidationState::IsValid ( ) const
inline

Definition at line 106 of file validation.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_debug_message

std::string ValidationState::m_debug_message
private

Definition at line 85 of file validation.h.

◆ m_mode

enum ValidationState::mode_state ValidationState::m_mode
private

◆ m_reject_reason

std::string ValidationState::m_reject_reason
private

Definition at line 84 of file validation.h.


The documentation for this class was generated from the following file: