NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
| 324 | |
| 325 | // NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller |
| 326 | static UniValue BIP22ValidationResult(const CValidationState& state) |
| 327 | { |
| 328 | if (state.IsValid()) |
| 329 | return NullUniValue; |
| 330 | |
| 331 | if (state.IsError()) |
| 332 | throw JSONRPCError(RPC_VERIFY_ERROR, FormatStateMessage(state)); |
| 333 | if (state.IsInvalid()) |
| 334 | { |
| 335 | std::string strRejectReason = state.GetRejectReason(); |
| 336 | if (strRejectReason.empty()) |
| 337 | return "rejected"; |
| 338 | return strRejectReason; |
| 339 | } |
| 340 | // Should be impossible |
| 341 | return "valid?"; |
| 342 | } |
| 343 | |
| 344 | static std::string gbt_vb_name(const Consensus::DeploymentPos pos) { |
| 345 | const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos]; |
no test coverage detected