mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-04 08:51:00 +02:00
rpc: Validate provided keys for query_options parameter in listunspent
With this change listunspent will throw an error if there is a wrong key in the query_option object. Signed-off-by: pasta <pasta@dashboost.org>
This commit is contained in:
parent
01b45b2e01
commit
a99a3c0bd6
@ -2898,6 +2898,15 @@ static UniValue listunspent(const JSONRPCRequest& request)
|
|||||||
if (!request.params[4].isNull()) {
|
if (!request.params[4].isNull()) {
|
||||||
const UniValue& options = request.params[4].get_obj();
|
const UniValue& options = request.params[4].get_obj();
|
||||||
|
|
||||||
|
RPCTypeCheckObj(options,
|
||||||
|
{
|
||||||
|
{"minimumAmount", UniValueType()},
|
||||||
|
{"maximumAmount", UniValueType()},
|
||||||
|
{"minimumSumAmount", UniValueType()},
|
||||||
|
{"maximumCount", UniValueType(UniValue::VNUM)},
|
||||||
|
},
|
||||||
|
true, true);
|
||||||
|
|
||||||
if (options.exists("minimumAmount"))
|
if (options.exists("minimumAmount"))
|
||||||
nMinimumAmount = AmountFromValue(options["minimumAmount"]);
|
nMinimumAmount = AmountFromValue(options["minimumAmount"]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user