Bitcoin Core  0.19.99
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>

Collaboration diagram for ValidationState< Result >:
[legend]

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  mode_state { MODE_VALID, MODE_INVALID, MODE_ERROR }
 

Private Attributes

enum ValidationState::mode_state MODE_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 78 of file validation.h.

Member Enumeration Documentation

◆ mode_state

template<typename Result>
enum ValidationState::mode_state
private
Enumerator
MODE_VALID 

everything ok

MODE_INVALID 

network rule violation (DoS value may be set)

MODE_ERROR 

run-time error

Definition at line 80 of file validation.h.

Member Function Documentation

◆ Error()

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

Definition at line 99 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 111 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 110 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 109 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 89 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 108 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 107 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 106 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 112 of file validation.h.

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 87 of file validation.h.

◆ m_reject_reason

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

Definition at line 86 of file validation.h.

◆ m_result

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

Definition at line 85 of file validation.h.

◆ MODE_VALID

template<typename Result>
enum ValidationState::mode_state ValidationState< Result >::MODE_VALID
private

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