NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
| 516 | |
| 517 | // NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller |
| 518 | static UniValue BIP22ValidationResult(const BlockValidationState& state) |
| 519 | { |
| 520 | if (state.IsValid()) |
| 521 | return NullUniValue; |
| 522 | |
| 523 | if (state.IsError()) |
| 524 | throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString()); |
| 525 | if (state.IsInvalid()) |
| 526 | { |
| 527 | std::string strRejectReason = state.GetRejectReason(); |
| 528 | if (strRejectReason.empty()) |
| 529 | return "rejected"; |
| 530 | return strRejectReason; |
| 531 | } |
| 532 | // Should be impossible |
| 533 | return "valid?"; |
| 534 | } |
| 535 | |
| 536 | static std::string gbt_vb_name(const Consensus::DeploymentPos pos) { |
| 537 | const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos]; |
no test coverage detected