6 #ifndef FABCOIN_CONSENSUS_VALIDATION_H 7 #define FABCOIN_CONSENSUS_VALIDATION_H 17 static const unsigned char REJECT_MALFORMED = 0x01;
18 static const unsigned char REJECT_INVALID = 0x10;
19 static const unsigned char REJECT_OBSOLETE = 0x11;
20 static const unsigned char REJECT_DUPLICATE = 0x12;
21 static const unsigned char REJECT_NONSTANDARD = 0x40;
23 static const unsigned char REJECT_INSUFFICIENTFEE = 0x42;
24 static const unsigned char REJECT_CHECKPOINT = 0x43;
41 bool DoS(
int level,
bool ret =
false,
42 unsigned int chRejectCodeIn=0,
const std::string &strRejectReasonIn=
"",
43 bool corruptionIn=
false,
44 const std::string &strDebugMessageIn=
"") {
45 chRejectCode = chRejectCodeIn;
46 strRejectReason = strRejectReasonIn;
47 corruptionPossible = corruptionIn;
48 strDebugMessage = strDebugMessageIn;
56 unsigned int _chRejectCode=0,
const std::string &_strRejectReason=
"",
57 const std::string &_strDebugMessage=
"") {
58 return DoS(0, ret, _chRejectCode, _strRejectReason,
false, _strDebugMessage);
60 bool Error(
const std::string& strRejectReasonIn) {
62 strRejectReason = strRejectReasonIn;
86 corruptionPossible =
true;
110 #endif // FABCOIN_CONSENSUS_VALIDATION_H unsigned int chRejectCode
size_t GetSerializeSize(const T &t, int nType, int nVersion=0)
enum CValidationState::mode_state mode
bool CorruptionPossible() const
network rule violation (DoS value may be set)
bool DoS(int level, bool ret=false, unsigned int chRejectCodeIn=0, const std::string &strRejectReasonIn="", bool corruptionIn=false, const std::string &strDebugMessageIn="")
void SetCorruptionPossible()
Parameters that influence chain consensus.
bool IsInvalid(int &nDoSOut) const
bool Error(const std::string &strRejectReasonIn)
std::string GetRejectReason() const
unsigned int GetRejectCode() const
Capture information about block/transaction validation.
std::string GetDebugMessage() const
std::string strRejectReason
std::string strDebugMessage
bool Invalid(bool ret=false, unsigned int _chRejectCode=0, const std::string &_strRejectReason="", const std::string &_strDebugMessage="")