Skip to content

Commit 72f3227

Browse files
committed
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.
1 parent 428ac70 commit 72f3227

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/validation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
/** Convert ValidationState to a human-readable message for logging */
1212
std::string FormatStateMessage(const ValidationState &state)
1313
{
14+
if (state.IsValid()) {
15+
return "Valid";
16+
}
17+
1418
return strprintf("%s%s",
1519
state.GetRejectReason(),
1620
state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage());

0 commit comments

Comments
 (0)