@@ -325,7 +325,7 @@ RPCHelpMan initpegoutwallet()
325325
326326 // Generate a new key that is added to wallet or set from argument
327327 CPubKey online_pubkey;
328- if (request.params . size () < 3 ) {
328+ if (request.params [ 2 ]. isNull () ) {
329329 std::string error;
330330 if (!pwallet->GetOnlinePakKey (online_pubkey, error)) {
331331 throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT , error);
@@ -342,7 +342,7 @@ RPCHelpMan initpegoutwallet()
342342
343343 // Parse offline counter
344344 int counter = 0 ;
345- if (request.params . size () > 1 ) {
345+ if (! request.params [ 1 ]. isNull () ) {
346346 counter = request.params [1 ].getInt <int >();
347347 if (counter < 0 || counter > 1000000000 ) {
348348 throw JSONRPCError (RPC_INVALID_PARAMETER , " bip32_counter must be between 0 and 1,000,000,000, inclusive." );
@@ -499,7 +499,7 @@ RPCHelpMan sendtomainchain_base()
499499 throw JSONRPCError (RPC_TYPE_ERROR , " Invalid amount for send" );
500500
501501 bool subtract_fee = false ;
502- if (request.params . size () > 2 ) {
502+ if (! request.params [ 2 ]. isNull () ) {
503503 subtract_fee = request.params [2 ].get_bool ();
504504 }
505505
@@ -520,7 +520,7 @@ RPCHelpMan sendtomainchain_base()
520520
521521 EnsureWalletIsUnlocked (*pwallet);
522522
523- bool verbose = request.params [3 ].isNull () ? false : request.params [3 ].get_bool ();
523+ bool verbose = request.params [3 ].isNull () ? false : request.params [3 ].get_bool ();
524524 mapValue_t mapValue;
525525 CCoinControl no_coin_control; // This is a deprecated API
526526 return SendMoney (*pwallet, no_coin_control, recipients, std::move (mapValue), verbose, true /* ignore_blind_fail */ );
@@ -612,7 +612,7 @@ RPCHelpMan sendtomainchain_pak()
612612 throw JSONRPCError (RPC_INVALID_PARAMETER , " Invalid amount for send, must send more than 0.00100000 BTC" );
613613
614614 bool subtract_fee = false ;
615- if (request.params . size () > 2 ) {
615+ if (! request.params [ 2 ]. isNull () ) {
616616 subtract_fee = request.params [2 ].get_bool ();
617617 }
618618
@@ -825,7 +825,7 @@ static UniValue createrawpegin(const JSONRPCRequest& request, T_tx_ref& txBTCRef
825825 std::vector<unsigned char > txOutProofData = ParseHex (request.params [1 ].get_str ());
826826
827827 std::set<CScript> claim_scripts;
828- if (request.params . size () > 2 ) {
828+ if (! request.params [ 2 ]. isNull () ) {
829829 const std::string claim_script = request.params [2 ].get_str ();
830830 if (!IsHex (claim_script)) {
831831 throw JSONRPCError (RPC_INVALID_PARAMETER , " Given claim_script is not hex." );
@@ -1270,12 +1270,12 @@ RPCHelpMan blindrawtransaction()
12701270 }
12711271
12721272 bool ignore_blind_fail = true ;
1273- if (request.params . size () > 1 ) {
1273+ if (! request.params [ 1 ]. isNull () ) {
12741274 ignore_blind_fail = request.params [1 ].get_bool ();
12751275 }
12761276
12771277 std::vector<std::vector<unsigned char > > auxiliary_generators;
1278- if (request.params . size () > 2 ) {
1278+ if (! request.params [ 2 ]. isNull () ) {
12791279 UniValue assetCommitments = request.params [2 ].get_array ();
12801280 if (assetCommitments.size () != 0 && assetCommitments.size () < tx.vin .size ()) {
12811281 throw JSONRPCError (RPC_INVALID_PARAMETER , " Asset commitment array must have at least as many entries as transaction inputs." );
@@ -1543,11 +1543,11 @@ RPCHelpMan issueasset()
15431543 throw JSONRPCError (RPC_TYPE_ERROR , " Issuance must have one non-zero component" );
15441544 }
15451545
1546- bool blind_issuances = request.params . size () < 3 || request.params [2 ].get_bool ();
1546+ bool blind_issuances = request.params [ 2 ]. isNull () || request.params [2 ].get_bool ();
15471547
15481548 // Check for optional contract to hash into definition
15491549 uint256 contract_hash;
1550- if (request.params . size () >= 4 ) {
1550+ if (! request.params [ 3 ]. isNull () ) {
15511551 contract_hash = ParseHashV (request.params [3 ], " contract_hash" );
15521552 }
15531553
@@ -1739,7 +1739,7 @@ RPCHelpMan listissuances()
17391739
17401740 std::string assetstr;
17411741 CAsset asset_filter;
1742- if (request.params . size () > 0 ) {
1742+ if (! request.params [ 0 ]. isNull () ) {
17431743 assetstr = request.params [0 ].get_str ();
17441744 asset_filter = GetAssetFromString (assetstr);
17451745 }
0 commit comments