Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 2,723 Lines • ▼ Show 20 Lines | static UniValue lockunspent(const Config &config, | ||||
for (size_t idx = 0; idx < outputs.size(); idx++) { | for (size_t idx = 0; idx < outputs.size(); idx++) { | ||||
const UniValue &output = outputs[idx]; | const UniValue &output = outputs[idx]; | ||||
if (!output.isObject()) { | if (!output.isObject()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, expected object"); | "Invalid parameter, expected object"); | ||||
} | } | ||||
const UniValue &o = output.get_obj(); | const UniValue &o = output.get_obj(); | ||||
RPCTypeCheckObj(o, { | RPCTypeCheckObj(o, | ||||
{ | |||||
{"txid", UniValueType(UniValue::VSTR)}, | {"txid", UniValueType(UniValue::VSTR)}, | ||||
{"vout", UniValueType(UniValue::VNUM)}, | {"vout", UniValueType(UniValue::VNUM)}, | ||||
}); | }); | ||||
std::string txid = find_value(o, "txid").get_str(); | std::string txid = find_value(o, "txid").get_str(); | ||||
if (!IsHex(txid)) { | if (!IsHex(txid)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, expected hex txid"); | "Invalid parameter, expected hex txid"); | ||||
} | } | ||||
int nOutput = find_value(o, "vout").get_int(); | int nOutput = find_value(o, "vout").get_int(); | ||||
▲ Show 20 Lines • Show All 640 Lines • Show Last 20 Lines |