You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #19100: refactor: Combine GetWalletForJSONRPCRequest and EnsureWalletIsAvailable functions
f42f5e5 refactor: Combine GetWalletForJSONRPCRequest and EnsureWalletIsAvailable functions (Russell Yanofsky)
Pull request description:
This simplifies control flow and also helps get rid of the ::vpwallets variable in #19101 since EnsureWalletIsAvailable doesn't have access to the request context.
ACKs for top commit:
MarcoFalke:
ACK f42f5e5 (reviewed code to check that this is a refactor) 💢
promag:
Tested ACK f42f5e5.
Tree-SHA512: eb10685de3db3c1d10c3a797d8da5c8c731e4a8c9024bbb7245929ba767a77a52783a739b8cb1fa7af6fcd233dcf9c8ebbe414eb8b902e2542601aac18625997
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
331
-
return NullUniValue;
332
-
}
333
325
334
326
RPCHelpMan{"importprunedfunds",
335
327
"\nImports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.\n",
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
389
-
return NullUniValue;
390
-
}
391
381
392
382
RPCHelpMan{"removeprunedfunds",
393
383
"\nDeletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.\n",
if (!EnsureWalletIsAvailable(pwallet, mainRequest.fHelp)) {
1265
-
return NullUniValue;
1266
-
}
1267
1247
1268
1248
RPCHelpMan{"importmulti",
1269
1249
"\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n"
if (!EnsureWalletIsAvailable(pwallet, main_request.fHelp)) {
1593
-
return NullUniValue;
1594
-
}
1595
1573
1596
1574
RPCHelpMan{"importdescriptors",
1597
1575
"\nImport descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.\n"
0 commit comments