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:
[
{
"walletname": "test",
"result": 0.00000000
},
{
"walletname": "wallet",
"result": 0.00000000
},
{
"walletname": "test2",
"result": 0.00000000
}
]
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