From fa3aadbc32e01386ddf54263d756b7a89b30addf Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 29 Jul 2026 16:49:57 +0200 Subject: [PATCH] refactor: Use self.Arg in getopenrpcinfo This is clearer, because it does not encode the default value in the source code syntax. Also, using named args is clearer than positional args. Also, run clang-format on the new code. --- src/rpc/server.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index d35fc699429..2ccdcfcbcf9 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -570,10 +570,10 @@ static RPCMethod getopenrpcinfo() + HelpExampleRpc("getopenrpcinfo", "") }, [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue -{ - const bool include_hidden{!request.params[0].isNull() && request.params[0].get_bool()}; - return tableRPC.buildOpenRPCDoc(include_hidden); -}, + { + const bool include_hidden{self.Arg("show_hidden")}; + return tableRPC.buildOpenRPCDoc(include_hidden); + }, }; } @@ -589,9 +589,9 @@ static RPCMethod rpc_discover() + HelpExampleRpc("rpc.discover", "") }, [](const RPCMethod&, const JSONRPCRequest&) -> UniValue -{ - return tableRPC.buildOpenRPCDoc(/*include_hidden=*/false); -}, + { + return tableRPC.buildOpenRPCDoc(/*include_hidden=*/false); + }, }; }