mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
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.
This commit is contained in:
parent
428ac70095
commit
72f3227c83
1 changed files with 4 additions and 0 deletions
|
@ -11,6 +11,10 @@
|
||||||
/** Convert ValidationState to a human-readable message for logging */
|
/** Convert ValidationState to a human-readable message for logging */
|
||||||
std::string FormatStateMessage(const ValidationState &state)
|
std::string FormatStateMessage(const ValidationState &state)
|
||||||
{
|
{
|
||||||
|
if (state.IsValid()) {
|
||||||
|
return "Valid";
|
||||||
|
}
|
||||||
|
|
||||||
return strprintf("%s%s",
|
return strprintf("%s%s",
|
||||||
state.GetRejectReason(),
|
state.GetRejectReason(),
|
||||||
state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage());
|
state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage());
|
||||||
|
|
Loading…
Add table
Reference in a new issue