message: Add function to convert CValidationState to a human-readable message
  backports bitcoin/bitcoin@9003c7cdd88402986e48ec126258fc10d6742fc7
  It is necessary to be able to concisely log a validation state.
  Convert CValidationState to a human-readable message for logging.
diff: @@ -949,6 +949,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(CTxMemPool& pool, CValidationState& state, const CTransaction& tx, bool fLimitFree,
  bool* pfMissingInputs, bool fOverrideMempoolLimit, bool fRejectInsaneFee, bool ignoreFees)
  