This PR is superseded by #10829
(This got closed and couldn’t be reopened because the branch pointer changed.)
This change allows existing RPCs to work on multiple wallets by calling those RPCs with a wallet=filename named argument. Example usage:
bitcoind -regtest -wallet=w1.dat -wallet=w2.dat
bitcoin-cli -regtest -named getwalletinfo wallet=w1.dat
bitcoin-cli -regtest -named getwalletinfo wallet=w2.dat
bitcoin-cli -regtest -named getbalance wallet=w2.dat
Individual RPCs can override handling of the wallet named argument, but if they
don’t, the GetWalletForJSONRPCRequest
function will automatically chose the
right wallet based on the argument value.
This change only allows JSON-RPC calls made with named arguments to access multiple wallets. JSON-RPC calls made with positional arguments will still continue to access the default wallet like before.