Changeset View
Changeset View
Standalone View
Standalone View
src/consensus/validation.h
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | private: | ||||
std::string strRejectReason; | std::string strRejectReason; | ||||
unsigned int chRejectCode; | unsigned int chRejectCode; | ||||
std::string strDebugMessage; | std::string strDebugMessage; | ||||
public: | public: | ||||
CValidationState() | CValidationState() | ||||
: mode(MODE_VALID), m_reason(ValidationInvalidReason::NONE), | : mode(MODE_VALID), m_reason(ValidationInvalidReason::NONE), | ||||
chRejectCode(0) {} | chRejectCode(0) {} | ||||
bool Invalid(ValidationInvalidReason reasonIn, bool ret = false, | bool Invalid(ValidationInvalidReason reasonIn, | ||||
unsigned int chRejectCodeIn = 0, | unsigned int chRejectCodeIn = 0, | ||||
const std::string &strRejectReasonIn = "", | const std::string &strRejectReasonIn = "", | ||||
const std::string &strDebugMessageIn = "") { | const std::string &strDebugMessageIn = "") { | ||||
m_reason = reasonIn; | m_reason = reasonIn; | ||||
chRejectCode = chRejectCodeIn; | chRejectCode = chRejectCodeIn; | ||||
strRejectReason = strRejectReasonIn; | strRejectReason = strRejectReasonIn; | ||||
strDebugMessage = strDebugMessageIn; | strDebugMessage = strDebugMessageIn; | ||||
if (mode == MODE_ERROR) { | if (mode == MODE_ERROR) { | ||||
return ret; | return false; | ||||
} | } | ||||
mode = MODE_INVALID; | mode = MODE_INVALID; | ||||
return ret; | return false; | ||||
} | } | ||||
bool Error(const std::string &strRejectReasonIn) { | bool Error(const std::string &strRejectReasonIn) { | ||||
if (mode == MODE_VALID) { | if (mode == MODE_VALID) { | ||||
strRejectReason = strRejectReasonIn; | strRejectReason = strRejectReasonIn; | ||||
} | } | ||||
mode = MODE_ERROR; | mode = MODE_ERROR; | ||||
return false; | return false; | ||||
Show All 11 Lines |