Would fix #18715. See discussion in #18453.
Currently, batching RPC requests across wallets does not work due to the fact that each wallet has its own endpoint.
This PR allows using a simple wildcard approach for the wallet endpoint (/wallet/*/
).
Using bitcoin-cli
-rpcwallet="*"
or -rpcwallet="pattern*
works with this PR.
This PR is a simple approach that allows detailed control on a per call basis. Some calls probably need special logic (rescanblockchain
). Some calls make not much sense across wallets (dumpwallet
or backupwallet
as example).
The output (or error/s) will be bundles as json array with a dictionary for each wallet:
0[
1 {
2 "walletname": "test",
3 "result": 0.00000000
4 },
5 {
6 "walletname": "wallet",
7 "result": 0.00000000
8 },
9 {
10 "walletname": "test2",
11 "result": 0.00000000
12 }
13]
Alternatives:
- implementing a generic approach on our httpserver/rpcserver layer (complicates layering)
- try to add it to the CRPCTable (overhead for non wallet calls)
- a dedicated “foreachwallet” RPC meta call
Todo:
- tests
- documentation