Changeset View
Changeset View
Standalone View
Standalone View
src/consensus/validation.h
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | bool Error(const std::string &reject_reason) { | ||||
m_mode = MODE_ERROR; | m_mode = MODE_ERROR; | ||||
return false; | return false; | ||||
} | } | ||||
bool IsValid() const { return m_mode == MODE_VALID; } | bool IsValid() const { return m_mode == MODE_VALID; } | ||||
bool IsInvalid() const { return m_mode == MODE_INVALID; } | bool IsInvalid() const { return m_mode == MODE_INVALID; } | ||||
bool IsError() const { return m_mode == MODE_ERROR; } | bool IsError() const { return m_mode == MODE_ERROR; } | ||||
std::string GetRejectReason() const { return m_reject_reason; } | std::string GetRejectReason() const { return m_reject_reason; } | ||||
std::string GetDebugMessage() const { return m_debug_message; } | std::string GetDebugMessage() const { return m_debug_message; } | ||||
std::string ToString() const { | |||||
if (IsValid()) { | |||||
return "Valid"; | |||||
} | |||||
if (!m_debug_message.empty()) { | |||||
return m_reject_reason + ", " + m_debug_message; | |||||
} | |||||
return m_reject_reason; | |||||
} | |||||
}; | }; | ||||
inline ValidationState::~ValidationState(){}; | inline ValidationState::~ValidationState(){}; | ||||
class TxValidationState : public ValidationState { | class TxValidationState : public ValidationState { | ||||
private: | private: | ||||
TxValidationResult m_result = TxValidationResult::TX_RESULT_UNSET; | TxValidationResult m_result = TxValidationResult::TX_RESULT_UNSET; | ||||
Show All 27 Lines |