scripted-diff: rpc: Don't pointlessly capture in RPCMethod lambdas

-BEGIN VERIFY SCRIPT-
sed -i 's/\[[&]\][(]const RPCMethod[&]/[](const RPCMethod\&/' $(git grep -l '\[\&\](const RPCMethod')
-END VERIFY SCRIPT-
This commit is contained in:
Anthony Towns
2026-02-20 21:07:29 +10:00
parent 4e789299af
commit 5a81d73a81
23 changed files with 169 additions and 169 deletions

View File

@@ -47,7 +47,7 @@ RPCMethod importprunedfunds()
},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{""},
[&](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
[](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return UniValue::VNULL;
@@ -105,7 +105,7 @@ RPCMethod removeprunedfunds()
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("removeprunedfunds", "\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"")
},
[&](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
[](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return UniValue::VNULL;
@@ -353,7 +353,7 @@ RPCMethod importdescriptors()
"{ \"desc\": \"<my descriptor 2>\", \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") +
HelpExampleCli("importdescriptors", "'[{ \"desc\": \"<my descriptor>\", \"timestamp\":1455191478, \"active\": true, \"range\": [0,100], \"label\": \"<my bech32 wallet>\" }]'")
},
[&](const RPCMethod& self, const JSONRPCRequest& main_request) -> UniValue
[](const RPCMethod& self, const JSONRPCRequest& main_request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(main_request);
if (!pwallet) return UniValue::VNULL;
@@ -491,7 +491,7 @@ RPCMethod listdescriptors()
HelpExampleCli("listdescriptors", "") + HelpExampleRpc("listdescriptors", "")
+ HelpExampleCli("listdescriptors", "true") + HelpExampleRpc("listdescriptors", "true")
},
[&](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
[](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
{
const std::shared_ptr<const CWallet> wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return UniValue::VNULL;
@@ -584,7 +584,7 @@ RPCMethod backupwallet()
HelpExampleCli("backupwallet", "\"backup.dat\"")
+ HelpExampleRpc("backupwallet", "\"backup.dat\"")
},
[&](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
[](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
{
const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return UniValue::VNULL;
@@ -634,7 +634,7 @@ RPCMethod restorewallet()
+ HelpExampleCliNamed("restorewallet", {{"wallet_name", "testwallet"}, {"backup_file", "home\\backups\\backup-file.bak\""}, {"load_on_startup", true}})
+ HelpExampleRpcNamed("restorewallet", {{"wallet_name", "testwallet"}, {"backup_file", "home\\backups\\backup-file.bak\""}, {"load_on_startup", true}})
},
[&](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
[](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
{
WalletContext& context = EnsureWalletContext(request.context);