aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/validation.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/consensus/validation.h b/src/consensus/validation.h
index 8a3abb31f4..4ead26a416 100644
--- a/src/consensus/validation.h
+++ b/src/consensus/validation.h
@@ -108,6 +108,18 @@ public:
bool IsError() const { return m_mode == MODE_ERROR; }
std::string GetRejectReason() const { return m_reject_reason; }
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() {};