From 30a6c999351041d6a1e8712a9659be1296a1b46a Mon Sep 17 00:00:00 2001 From: stickies-v Date: Thu, 18 Jan 2024 17:27:50 +0000 Subject: rpc: access some args by name Use the new key-based Arg helper in a few locations to show how it is used. --- src/wallet/rpc/coins.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index 0cb0891141..b6c7396f4b 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -194,15 +194,12 @@ RPCHelpMan getbalance() LOCK(pwallet->cs_wallet); - const auto dummy_value{self.MaybeArg(0)}; + const auto dummy_value{self.MaybeArg("dummy")}; if (dummy_value && *dummy_value != "*") { throw JSONRPCError(RPC_METHOD_DEPRECATED, "dummy first argument must be excluded or set to \"*\"."); } - int min_depth = 0; - if (!request.params[1].isNull()) { - min_depth = request.params[1].getInt(); - } + const auto min_depth{self.Arg("minconf")}; bool include_watchonly = ParseIncludeWatchonly(request.params[2], *pwallet); -- cgit v1.2.3