NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
| 303 | |
| 304 | // NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller |
| 305 | static UniValue BIP22ValidationResult(const CValidationState& state) |
| 306 | { |
| 307 | if (state.IsValid()) |
| 308 | return NullUniValue; |
| 309 | |
| 310 | std::string strRejectReason = state.GetRejectReason(); |
| 311 | if (state.IsError()) |
| 312 | throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason); |
| 313 | if (state.IsInvalid()) |
| 314 | { |
| 315 | if (strRejectReason.empty()) |
| 316 | return "rejected"; |
| 317 | return strRejectReason; |
| 318 | } |
| 319 | // Should be impossible |
| 320 | return "valid?"; |
| 321 | } |
| 322 | |
| 323 | UniValue getblocktemplate(const UniValue& params, bool fHelp) |
| 324 | { |
no test coverage detected