Dash Core  0.12.2.1
P2P Digital Currency
CValidationState Class Reference

#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 
MODE_INVALID 

everything ok

MODE_ERROR 

network rule violation (DoS value may be set)

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

Definition at line 77 of file validation.h.

Referenced by AcceptBlock(), ActivateBestChainStep(), and InvalidBlockFound().

◆ DoS()

bool CValidationState::DoS ( int  level,
bool  ret = false,
unsigned int  chRejectCodeIn = 0,
const std::string &  strRejectReasonIn = "",
bool  corruptionIn = false,
const std::string &  strDebugMessageIn = "" 
)
inline

◆ Error()

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

Definition at line 55 of file validation.h.

Referenced by FindBlockPos(), FindUndoPos(), and FlushStateToDisk().

◆ GetDebugMessage()

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

Definition at line 82 of file validation.h.

Referenced by 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.

Referenced by BIP22ValidationResult(), and LoadExternalBlockFile().

◆ IsInvalid() [1/2]

bool CValidationState::IsInvalid ( ) const
inline

◆ IsInvalid() [2/2]

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

Definition at line 70 of file validation.h.

◆ 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: