NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
| 311 | |
| 312 | // NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller |
| 313 | static UniValue BIP22ValidationResult(const CValidationState& state) |
| 314 | { |
| 315 | if (state.IsValid()) |
| 316 | return NullUniValue; |
| 317 | |
| 318 | std::string strRejectReason = state.GetRejectReason(); |
| 319 | if (state.IsError()) |
| 320 | throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason); |
| 321 | if (state.IsInvalid()) { |
| 322 | if (strRejectReason.empty()) |
| 323 | return "rejected"; |
| 324 | return strRejectReason; |
| 325 | } |
| 326 | // Should be impossible |
| 327 | return "valid?"; |
| 328 | } |
| 329 | |
| 330 | std::string gbt_vb_name(const Consensus::DeploymentPos pos) { |
| 331 | const struct BIP9DeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos]; |
no test coverage detected