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

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

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    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.

    <!--- What behavior did you expect? -->

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

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    To reproduce

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    System information

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  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
Contributors
Labels

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: 2026-04-29 03:14 UTC

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