7 #ifndef RAVEN_CONSENSUS_VALIDATION_H 8 #define RAVEN_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;
26 static const unsigned char REJECT_MAXREORGDEPTH = 0x44;
44 bool DoS(
int level,
bool ret =
false,
45 unsigned int chRejectCodeIn=0,
const std::string &strRejectReasonIn=
"",
46 bool corruptionIn=
false,
47 const std::string &strDebugMessageIn=
"") {
48 chRejectCode = chRejectCodeIn;
49 strRejectReason = strRejectReasonIn;
50 corruptionPossible = corruptionIn;
51 strDebugMessage = strDebugMessageIn;
59 unsigned int _chRejectCode=0,
const std::string &_strRejectReason=
"",
60 const std::string &_strDebugMessage=
"") {
61 return DoS(0, ret, _chRejectCode, _strRejectReason,
false, _strDebugMessage);
63 bool Error(
const std::string& strRejectReasonIn) {
65 strRejectReason = strRejectReasonIn;
89 corruptionPossible =
true;
100 static inline int64_t GetTransactionWeight(
const CTransaction& tx)
104 static inline int64_t GetBlockWeight(
const CBlock& block)
109 #endif // RAVEN_CONSENSUS_VALIDATION_H
unsigned int chRejectCode
size_t GetSerializeSize(const T &t, int nType, int nVersion=0)
enum CValidationState::mode_state mode
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="")
bool IsInvalid(int &nDoSOut) const
void SetCorruptionPossible()
std::string GetRejectReason() const
bool Error(const std::string &strRejectReasonIn)
std::string GetDebugMessage() const
unsigned int GetRejectCode() const
bool CorruptionPossible() const
std::string strRejectReason
The basic transaction that is broadcasted on the network and contained in blocks. ...
std::string strDebugMessage
bool Invalid(bool ret=false, unsigned int _chRejectCode=0, const std::string &_strRejectReason="", const std::string &_strDebugMessage="")