RPC request gives an exception on more than two wallet has been loaded. #26980

issue tunerji openend this issue on January 27, 2023
  1. tunerji commented at 7:07 pm on January 27, 2023: none

    RPC request gives an exception on more than two wallet has been loaded. But it is working as normal when only one of them opened. Therefore, it makes it difficult to operate using multiple api on Bitcoincore. Expected behavior working with no exception when we call the wallet using API.

    Actual behavior the exception message : Wallet file not specified (must request wallet RPC through /wallet/ uri-path). || 27-Jan-23 15:21:46

    To reproduce

    System information

  2. tunerji added the label Bug on Jan 27, 2023
  3. achow101 commented at 7:58 pm on January 27, 2023: member
    There are multiple wallets loaded, so you need to specify which one you want to interact with. When there’s only one, it’s obvious which to use. It also works for backwards compatibility reasons. The error message says everything you need to know.
  4. achow101 closed this on Jan 27, 2023

  5. tunerji commented at 8:52 pm on January 27, 2023: none
    I did not see the way of specifying using rpc. Could you give me an example like getbalance, listlabels or listunspent ?
  6. achow101 commented at 8:57 pm on January 27, 2023: member
    Instead of sending your request to http://127.0.0.1:8332/, you should send it to http://127.0.0.1:8332/wallet/mywallet in order to interact with the wallet named mywallet. If you are using bitcoin-cli, you would use the -rpcwallet= option, e.g. bitcoin-cli -rpcwallet=mywallet.
  7. tunerji commented at 5:31 am on January 28, 2023: none
    I will try. Thank you very much.
  8. bitcoin locked this on Jan 28, 2024


tunerji achow101

Labels
Bug


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-29 10:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me