MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / ParseHashV

Function ParseHashV

src/rpc/server.cpp:118–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118uint256 ParseHashV(const UniValue& v, std::string strName)
119{
120 std::string strHex;
121 if (v.isStr())
122 strHex = v.get_str();
123 if (!IsHex(strHex)) // Note: IsHex("") is false
124 throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')");
125 if (64 != strHex.length())
126 throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be of length %d (not %d)", strName, 64, strHex.length()));
127 uint256 result;
128 result.SetHex(strHex);
129 return result;
130}
131uint256 ParseHashO(const UniValue& o, std::string strKey)
132{
133 return ParseHashV(find_value(o, strKey), strKey);

Callers 5

getrawtransactionFunction · 0.85
ParseHashOFunction · 0.85
getmempoolancestorsFunction · 0.85
getmempooldescendantsFunction · 0.85
getmempoolentryFunction · 0.85

Calls 4

IsHexFunction · 0.85
JSONRPCErrorFunction · 0.85
isStrMethod · 0.80
SetHexMethod · 0.45

Tested by

no test coverage detected