mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-03 08:21:29 +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()) {
|
||||
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"))
|
||||
nMinimumAmount = AmountFromValue(options["minimumAmount"]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user