MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ParseSighashString

Function ParseSighashString

src/rpc/util.cpp:357–367  ·  view source on GitHub ↗

* Returns a sighash value corresponding to the passed in argument. * * @pre The sighash argument should be string or null. */

Source from the content-addressed store, hash-verified

355 * @pre The sighash argument should be string or null.
356*/
357std::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
369unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target)
370{

Callers 5

walletprocesspsbtFunction · 0.85
parse_univalue.cppFile · 0.85
descriptorprocesspsbtFunction · 0.85
SignTransactionFunction · 0.85

Calls 5

SighashFromStrFunction · 0.85
JSONRPCErrorFunction · 0.85
ErrorStringFunction · 0.85
isNullMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected