mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +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:
@ -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"]);
|
||||
|
||||
|
Reference in New Issue
Block a user