Convert CValidationState to a human-readable message for logging */
| 61 | |
| 62 | /** Convert CValidationState to a human-readable message for logging */ |
| 63 | std::string FormatStateMessage(const CValidationState &state) |
| 64 | { |
| 65 | return strprintf("%s%s (code %i)", |
| 66 | state.GetRejectReason(), |
| 67 | state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage(), |
| 68 | state.GetRejectCode()); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Calculates the block height and previous block's median time past at |