diff options
| author | Jeffrey Czyz <[email protected]> | 2019-11-08 13:22:36 -0800 |
|---|---|---|
| committer | Jeffrey Czyz <[email protected]> | 2020-02-27 17:59:07 -0800 |
| commit | 0aed17ef2892478c28cd660e53223c6dd1dc0187 (patch) | |
| tree | dc2290695c6d65e7917df9d83e8e4da5f5ce6e1a /src/consensus/validation.h | |
| parent | Merge #18212: doc: add missing step in win deployment instructions (diff) | |
| download | discoin-0aed17ef2892478c28cd660e53223c6dd1dc0187.tar.xz discoin-0aed17ef2892478c28cd660e53223c6dd1dc0187.zip | |
Refactor FormatStateMessage into ValidationState
Diffstat (limited to 'src/consensus/validation.h')
| -rw-r--r-- | src/consensus/validation.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/consensus/validation.h b/src/consensus/validation.h index 8a3abb31f..4ead26a41 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() {}; |