diff --git a/src/main.cpp b/src/main.cpp index bf3fb3bc2..5dfa4fc2d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1715,6 +1715,14 @@ CAmount GetMinRelayFee(const CTransaction& tx, const CTxMemPool& pool, unsigned return nMinFee; } +/** Convert CValidationState to a human-readable message for logging */ +static std::string FormatStateMessage(const CValidationState &state) +{ + return strprintf("%s%s (code %i)", + state.GetRejectReason(), + state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage(), + state.GetRejectCode()); +} bool AcceptToMemoryPool( const CChainParams& chainparams,