Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

Capture information about block/transaction validation. More...

#include <validation.h>

Public Member Functions

 CValidationState ()
 
bool DoS (int level, bool ret=false, unsigned int chRejectCodeIn=0, const std::string &strRejectReasonIn="", bool corruptionIn=false, const std::string &strDebugMessageIn="")
 
bool Invalid (bool ret=false, unsigned int _chRejectCode=0, const std::string &_strRejectReason="", const std::string &_strDebugMessage="")
 
bool Error (const std::string &strRejectReasonIn)
 
bool IsValid () const
 
bool IsInvalid () const
 
bool IsError () const
 
bool IsInvalid (int &nDoSOut) const
 
bool CorruptionPossible () const
 
unsigned int GetRejectCode () const
 
std::string GetRejectReason () const
 
std::string GetDebugMessage () const
 

Private Types

enum  mode_state { MODE_VALID, MODE_INVALID, MODE_ERROR }
 

Private Attributes

enum CValidationState::mode_state mode
 
int nDoS
 
std::string strRejectReason
 
unsigned int chRejectCode
 
bool corruptionPossible
 
std::string strDebugMessage
 

Detailed Description

Capture information about block/transaction validation.

Definition at line 22 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 24 of file validation.h.

Constructor & Destructor Documentation

◆ CValidationState()

CValidationState::CValidationState ( )
inline

Definition at line 35 of file validation.h.

Member Function Documentation

◆ CorruptionPossible()

bool CValidationState::CorruptionPossible ( ) const
inline

◆ DoS()

◆ Error()

bool CValidationState::Error ( const std::string &  strRejectReasonIn)
inline

Definition at line 55 of file validation.h.

References mode, MODE_ERROR, MODE_VALID, and strRejectReason.

Referenced by CChainState::AcceptBlock(), FindUndoPos(), and FlushStateToDisk().

◆ GetDebugMessage()

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

Definition at line 82 of file validation.h.

References strDebugMessage.

Referenced by AcceptToMemoryPoolWithTime(), CheckBlock(), and FormatStateMessage().

◆ GetRejectCode()

unsigned int CValidationState::GetRejectCode ( ) const
inline

◆ GetRejectReason()

◆ Invalid()

bool CValidationState::Invalid ( bool  ret = false,
unsigned int  _chRejectCode = 0,
const std::string &  _strRejectReason = "",
const std::string &  _strDebugMessage = "" 
)
inline

◆ IsError()

bool CValidationState::IsError ( ) const
inline

Definition at line 67 of file validation.h.

References mode, and MODE_ERROR.

Referenced by BIP22ValidationResult(), and LoadExternalBlockFile().

◆ IsInvalid() [1/2]

◆ IsInvalid() [2/2]

bool CValidationState::IsInvalid ( int &  nDoSOut) const
inline

Definition at line 70 of file validation.h.

References IsInvalid(), and nDoS.

◆ IsValid()

bool CValidationState::IsValid ( ) const
inline

Member Data Documentation

◆ chRejectCode

unsigned int CValidationState::chRejectCode
private

Definition at line 31 of file validation.h.

Referenced by DoS(), and GetRejectCode().

◆ corruptionPossible

bool CValidationState::corruptionPossible
private

Definition at line 32 of file validation.h.

Referenced by CorruptionPossible(), and DoS().

◆ mode

enum CValidationState::mode_state CValidationState::mode
private

Referenced by DoS(), Error(), IsError(), IsInvalid(), and IsValid().

◆ nDoS

int CValidationState::nDoS
private

Definition at line 29 of file validation.h.

Referenced by DoS(), and IsInvalid().

◆ strDebugMessage

std::string CValidationState::strDebugMessage
private

Definition at line 33 of file validation.h.

Referenced by DoS(), and GetDebugMessage().

◆ strRejectReason

std::string CValidationState::strRejectReason
private

Definition at line 30 of file validation.h.

Referenced by DoS(), Error(), and GetRejectReason().


The documentation for this class was generated from the following file:
Released under the MIT license