Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Types | Private Attributes | List of all members
ValidationState< Result > Class Template Reference

Template for capturing information about block/transaction validation. More...

#include <validation.h>

Public Member Functions

bool Invalid (Result result, const std::string &reject_reason="", const std::string &debug_message="")
 
bool Error (const std::string &reject_reason)
 
bool IsValid () const
 
bool IsInvalid () const
 
bool IsError () const
 
Result GetResult () const
 
std::string GetRejectReason () const
 
std::string GetDebugMessage () const
 
std::string ToString () const
 

Private Types

enum class  ModeState { M_VALID , M_INVALID , M_ERROR }
 

Private Attributes

enum ValidationState::ModeState M_VALID
 
Result m_result {}
 
std::string m_reject_reason
 
std::string m_debug_message
 

Detailed Description

template<typename Result>
class ValidationState< Result >

Template for capturing information about block/transaction validation.

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

Definition at line 92 of file validation.h.

Member Enumeration Documentation

◆ ModeState

template<typename Result >
enum ValidationState::ModeState
strongprivate
Enumerator
M_VALID 

everything ok

M_INVALID 

network rule violation (DoS value may be set)

M_ERROR 

run-time error

Definition at line 95 of file validation.h.

Member Function Documentation

◆ Error()

template<typename Result >
bool ValidationState< Result >::Error ( const std::string &  reject_reason)
inline

Definition at line 115 of file validation.h.

Here is the caller graph for this function:

◆ GetDebugMessage()

template<typename Result >
std::string ValidationState< Result >::GetDebugMessage ( ) const
inline

Definition at line 127 of file validation.h.

Here is the caller graph for this function:

◆ GetRejectReason()

template<typename Result >
std::string ValidationState< Result >::GetRejectReason ( ) const
inline

Definition at line 126 of file validation.h.

Here is the caller graph for this function:

◆ GetResult()

template<typename Result >
Result ValidationState< Result >::GetResult ( ) const
inline

Definition at line 125 of file validation.h.

Here is the caller graph for this function:

◆ Invalid()

template<typename Result >
bool ValidationState< Result >::Invalid ( Result  result,
const std::string &  reject_reason = "",
const std::string &  debug_message = "" 
)
inline

Definition at line 105 of file validation.h.

Here is the caller graph for this function:

◆ IsError()

template<typename Result >
bool ValidationState< Result >::IsError ( ) const
inline

Definition at line 124 of file validation.h.

Here is the caller graph for this function:

◆ IsInvalid()

template<typename Result >
bool ValidationState< Result >::IsInvalid ( ) const
inline

Definition at line 123 of file validation.h.

Here is the caller graph for this function:

◆ IsValid()

template<typename Result >
bool ValidationState< Result >::IsValid ( ) const
inline

Definition at line 122 of file validation.h.

Here is the caller graph for this function:

◆ ToString()

template<typename Result >
std::string ValidationState< Result >::ToString ( ) const
inline

Definition at line 128 of file validation.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_debug_message

template<typename Result >
std::string ValidationState< Result >::m_debug_message
private

Definition at line 102 of file validation.h.

◆ m_reject_reason

template<typename Result >
std::string ValidationState< Result >::m_reject_reason
private

Definition at line 101 of file validation.h.

◆ m_result

template<typename Result >
Result ValidationState< Result >::m_result {}
private

Definition at line 100 of file validation.h.

◆ M_VALID

template<typename Result >
enum ValidationState::ModeState ValidationState< Result >::M_VALID
private

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