Changeset View
Changeset View
Standalone View
Standalone View
src/consensus/validation.h
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | bool Error(const std::string &strRejectReasonIn) { | ||||
mode = MODE_ERROR; | mode = MODE_ERROR; | ||||
return false; | return false; | ||||
} | } | ||||
bool IsValid() const { return mode == MODE_VALID; } | bool IsValid() const { return mode == MODE_VALID; } | ||||
bool IsInvalid() const { return mode == MODE_INVALID; } | bool IsInvalid() const { return mode == MODE_INVALID; } | ||||
bool IsError() const { return mode == MODE_ERROR; } | bool IsError() const { return mode == MODE_ERROR; } | ||||
bool IsInvalid(int &nDoSOut) const { | |||||
if (IsInvalid()) { | |||||
nDoSOut = nDoS; | |||||
return true; | |||||
} | |||||
return false; | |||||
} | |||||
bool CorruptionPossible() const { return corruptionPossible; } | bool CorruptionPossible() const { return corruptionPossible; } | ||||
void SetCorruptionPossible() { corruptionPossible = true; } | void SetCorruptionPossible() { corruptionPossible = true; } | ||||
int GetDoS() const { return nDoS; } | int GetDoS() const { return nDoS; } | ||||
unsigned int GetRejectCode() const { return chRejectCode; } | unsigned int GetRejectCode() const { return chRejectCode; } | ||||
std::string GetRejectReason() const { return strRejectReason; } | std::string GetRejectReason() const { return strRejectReason; } | ||||
std::string GetDebugMessage() const { return strDebugMessage; } | std::string GetDebugMessage() const { return strDebugMessage; } | ||||
}; | }; | ||||
#endif // BITCOIN_CONSENSUS_VALIDATION_H | #endif // BITCOIN_CONSENSUS_VALIDATION_H |