Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 1,281 Lines • ▼ Show 20 Lines | if (!parsed_desc->IsRange() && data.exists("range")) { | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
"Range should not be specified for an un-ranged descriptor"); | "Range should not be specified for an un-ranged descriptor"); | ||||
} else if (parsed_desc->IsRange()) { | } else if (parsed_desc->IsRange()) { | ||||
if (!data.exists("range")) { | if (!data.exists("range")) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
"Descriptor is ranged, please specify the range"); | "Descriptor is ranged, please specify the range"); | ||||
} | } | ||||
const UniValue &range = data["range"]; | auto range = ParseRange(data["range"]); | ||||
range_start = range.exists("start") ? range["start"].get_int64() : 0; | range_start = range.first; | ||||
if (!range.exists("end")) { | range_end = range.second; | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | if (range_start < 0 || (range_end >> 31) != 0 || | ||||
"End of range for descriptor must be specified"); | range_end - range_start >= 1000000) { | ||||
} | |||||
range_end = range["end"].get_int64(); | |||||
if (range_end < range_start || range_start < 0) { | |||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid descriptor range specified"); | "Invalid descriptor range specified"); | ||||
} | } | ||||
} | } | ||||
const UniValue &priv_keys = | const UniValue &priv_keys = | ||||
data.exists("keys") ? data["keys"].get_array() : UniValue(); | data.exists("keys") ? data["keys"].get_array() : UniValue(); | ||||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
/* default */ "empty array", | /* default */ "empty array", | ||||
"Array of strings giving private keys to import. The " | "Array of strings giving private keys to import. The " | ||||
"corresponding public keys must occur in the output " | "corresponding public keys must occur in the output " | ||||
"or redeemscript.", | "or redeemscript.", | ||||
{ | { | ||||
{"key", RPCArg::Type::STR, | {"key", RPCArg::Type::STR, | ||||
RPCArg::Optional::OMITTED, ""}, | RPCArg::Optional::OMITTED, ""}, | ||||
}}, | }}, | ||||
{"range", | {"range", RPCArg::Type::RANGE, | ||||
RPCArg::Type::OBJ, | |||||
RPCArg::Optional::OMITTED, | RPCArg::Optional::OMITTED, | ||||
"If a ranged descriptor is used, this specifies the " | "If a ranged descriptor is used, this specifies the " | ||||
"start and end of the range to import", | "end or the range (in the form [begin,end]) to " | ||||
{ | "import"}, | ||||
{"start", RPCArg::Type::NUM, | |||||
/* default */ "0", | |||||
"Start of the range to import"}, | |||||
{"end", RPCArg::Type::NUM, RPCArg::Optional::NO, | |||||
"End of the range to import (inclusive)"}, | |||||
}}, | |||||
{"internal", RPCArg::Type::BOOL, | {"internal", RPCArg::Type::BOOL, | ||||
/* default */ "false", | /* default */ "false", | ||||
"Stating whether matching outputs should be treated " | "Stating whether matching outputs should be treated " | ||||
"as not incoming payments (also known as change)"}, | "as not incoming payments (also known as change)"}, | ||||
{"watchonly", RPCArg::Type::BOOL, | {"watchonly", RPCArg::Type::BOOL, | ||||
/* default */ "false", | /* default */ "false", | ||||
"Stating whether matching outputs should be " | "Stating whether matching outputs should be " | ||||
"considered watched even when not all private keys " | "considered watched even when not all private keys " | ||||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |