* Returns a sighash value corresponding to the passed in argument. * * @pre The sighash argument should be string or null. */
| 355 | * @pre The sighash argument should be string or null. |
| 356 | */ |
| 357 | std::optional<int> ParseSighashString(const UniValue& sighash) |
| 358 | { |
| 359 | if (sighash.isNull()) { |
| 360 | return std::nullopt; |
| 361 | } |
| 362 | const auto result{SighashFromStr(sighash.get_str())}; |
| 363 | if (!result) { |
| 364 | throw JSONRPCError(RPC_INVALID_PARAMETER, util::ErrorString(result).original); |
| 365 | } |
| 366 | return result.value(); |
| 367 | } |
| 368 | |
| 369 | unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target) |
| 370 | { |
no test coverage detected