diff options
| author | Jeffrey Czyz <[email protected]> | 2020-01-03 11:32:22 -0800 |
|---|---|---|
| committer | Jeffrey Czyz <[email protected]> | 2020-01-03 11:37:26 -0800 |
| commit | 72f3227c83810936e7a334304e5fd7c6dab8e91b (patch) | |
| tree | a8602fb4ba8ad989b38189b42e78b6eec7c1cfe1 /src/util | |
| parent | Add VALIDATION to BCLog::LogFlags (diff) | |
| download | discoin-72f3227c83810936e7a334304e5fd7c6dab8e91b.tar.xz discoin-72f3227c83810936e7a334304e5fd7c6dab8e91b.zip | |
Format CValidationState properly in all cases
FormatStateMessage does not properly handle the case where
CValidationState::IsValid() returns true. Use "Valid" for the state in
this case.
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/validation.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/validation.cpp b/src/util/validation.cpp index bd52f5775..603db51d4 100644 --- a/src/util/validation.cpp +++ b/src/util/validation.cpp @@ -11,6 +11,10 @@ /** Convert ValidationState to a human-readable message for logging */ std::string FormatStateMessage(const ValidationState &state) { + if (state.IsValid()) { + return "Valid"; + } + return strprintf("%s%s", state.GetRejectReason(), state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage()); |