@@ -330,7 +330,7 @@ RPCHelpMan initpegoutwallet()
330330
331331 // Generate a new key that is added to wallet or set from argument
332332 CPubKey online_pubkey;
333- if (request.params . size () < 3 ) {
333+ if (request.params [ 2 ]. isNull () ) {
334334 std::string error;
335335 if (!pwallet->GetOnlinePakKey (online_pubkey, error)) {
336336 throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT , error);
@@ -347,7 +347,7 @@ RPCHelpMan initpegoutwallet()
347347
348348 // Parse offline counter
349349 int counter = 0 ;
350- if (request.params . size () > 1 ) {
350+ if (! request.params [ 1 ]. isNull () ) {
351351 counter = request.params [1 ].get_int ();
352352 if (counter < 0 || counter > 1000000000 ) {
353353 throw JSONRPCError (RPC_INVALID_PARAMETER , " bip32_counter must be between 0 and 1,000,000,000, inclusive." );
@@ -502,7 +502,7 @@ RPCHelpMan sendtomainchain_base()
502502 throw JSONRPCError (RPC_TYPE_ERROR , " Invalid amount for send" );
503503
504504 bool subtract_fee = false ;
505- if (request.params . size () > 2 ) {
505+ if (! request.params [ 2 ]. isNull () ) {
506506 subtract_fee = request.params [2 ].get_bool ();
507507 }
508508
@@ -523,7 +523,7 @@ RPCHelpMan sendtomainchain_base()
523523
524524 EnsureWalletIsUnlocked (*pwallet);
525525
526- bool verbose = request.params [3 ].isNull () ? false : request.params [3 ].get_bool ();
526+ bool verbose = request.params [3 ].isNull () ? false : request.params [3 ].get_bool ();
527527 mapValue_t mapValue;
528528 CCoinControl no_coin_control; // This is a deprecated API
529529 return SendMoney (*pwallet, no_coin_control, recipients, std::move (mapValue), verbose, true /* ignore_blind_fail */ );
@@ -615,7 +615,7 @@ RPCHelpMan sendtomainchain_pak()
615615 throw JSONRPCError (RPC_INVALID_PARAMETER , " Invalid amount for send, must send more than 0.00100000 BTC" );
616616
617617 bool subtract_fee = false ;
618- if (request.params . size () > 2 ) {
618+ if (! request.params [ 2 ]. isNull () ) {
619619 subtract_fee = request.params [2 ].get_bool ();
620620 }
621621
@@ -827,7 +827,7 @@ static UniValue createrawpegin(const JSONRPCRequest& request, T_tx_ref& txBTCRef
827827 std::vector<unsigned char > txOutProofData = ParseHex (request.params [1 ].get_str ());
828828
829829 std::set<CScript> claim_scripts;
830- if (request.params . size () > 2 ) {
830+ if (! request.params [ 2 ]. isNull () ) {
831831 const std::string claim_script = request.params [2 ].get_str ();
832832 if (!IsHex (claim_script)) {
833833 throw JSONRPCError (RPC_INVALID_PARAMETER , " Given claim_script is not hex." );
@@ -1273,12 +1273,12 @@ RPCHelpMan blindrawtransaction()
12731273 }
12741274
12751275 bool ignore_blind_fail = true ;
1276- if (request.params . size () > 1 ) {
1276+ if (! request.params [ 1 ]. isNull () ) {
12771277 ignore_blind_fail = request.params [1 ].get_bool ();
12781278 }
12791279
12801280 std::vector<std::vector<unsigned char > > auxiliary_generators;
1281- if (request.params . size () > 2 ) {
1281+ if (! request.params [ 2 ]. isNull () ) {
12821282 UniValue assetCommitments = request.params [2 ].get_array ();
12831283 if (assetCommitments.size () != 0 && assetCommitments.size () < tx.vin .size ()) {
12841284 throw JSONRPCError (RPC_INVALID_PARAMETER , " Asset commitment array must have at least as many entries as transaction inputs." );
@@ -1542,11 +1542,11 @@ RPCHelpMan issueasset()
15421542 throw JSONRPCError (RPC_TYPE_ERROR , " Issuance must have one non-zero component" );
15431543 }
15441544
1545- bool blind_issuances = request.params . size () < 3 || request.params [2 ].get_bool ();
1545+ bool blind_issuances = request.params [ 2 ]. isNull () || request.params [2 ].get_bool ();
15461546
15471547 // Check for optional contract to hash into definition
15481548 uint256 contract_hash;
1549- if (request.params . size () >= 4 ) {
1549+ if (! request.params [ 3 ]. isNull () ) {
15501550 contract_hash = ParseHashV (request.params [3 ], " contract_hash" );
15511551 }
15521552
@@ -1733,7 +1733,7 @@ RPCHelpMan listissuances()
17331733
17341734 std::string assetstr;
17351735 CAsset asset_filter;
1736- if (request.params . size () > 0 ) {
1736+ if (! request.params [ 0 ]. isNull () ) {
17371737 assetstr = request.params [0 ].get_str ();
17381738 asset_filter = GetAssetFromString (assetstr);
17391739 }
0 commit comments