"bitcoin-cli help" does not show how to encrypt additional multi wallets #11588

issue juestr opened this issue on October 31, 2017
  1. juestr commented at 10:27 PM on October 31, 2017: none

    Describe the issue

    I added a second new wallet2.dat. Now I wanted to encrypt it, but bitcoin-cli help does not show the command to do so, I need to use bitcoin-cli -rpcwallet=wallet2.dat help. This is very un-intuitive, and bad for a help function.

    Can you reliably reproduce the issue?

    1. have an encrypted default wallet
    2. add new multi wallet wallet2.dat via config file or cmd line options
    3. naive bitcoin-cli help does not show command to encrypt second wallet.

    Expected behaviour

    All wallet encryption, lock and unlock commands should be shown unconditionally in bitcoin-cli help.

    The dynamic hiding of some lines is arguably worse than the benefit with multiple wallets.

    Actual behaviour

    bitcoin-cli help shows only wallet encryption commands appropriate for the default wallet.

    What version of bitcoin-core are you using?

    bitcoind 0.15.0.1~dfsg-1 deb http://ppa.launchpad.net/luke-jr/bitcoin-core-bip148-unofficial-builds/ubuntu zesty main

    Machine specs:

    • OS: Debian 9.2
  2. fanquake added the label Docs and Output on Oct 31, 2017
  3. fanquake added the label RPC/REST/ZMQ on Oct 31, 2017
  4. jonasschnelli commented at 12:34 AM on November 1, 2017: contributor

    I can't reproduce your issue. bitcoin-cli help does show encryptwallet "passphrase" if you haven't disabled wallet support (through compile option or via -disablewallet).

    Calling encryptwallet does requires you to define which wallet you want to encrypt though bitcoin-cli's -rpcwallet=<filename>.

    Not sure if the PPA you are using has the same internals and APIs as bitcoin core 0.15.0.1.

  5. juestr commented at 12:37 AM on November 1, 2017: none

    Did you test in a multi wallet setup, with the first (default) wallet encrypted, and the second one not?

  6. jonasschnelli commented at 12:45 AM on November 1, 2017: contributor

    Yes. I tested it in multiwallet:

    Start multiwallet, fresh wallets: ./src/qt/bitcoin-qt --regtest --wallet=wallet1 --wallet=wallet2 --server

    Encrypt wallet1: ./src/bitcoin-cli -rpcwallet=wallet1 --regtest encryptwallet test (Core stops at this point)

    Start again: ./src/qt/bitcoin-qt --regtest --wallet=wallet1 --wallet=wallet2 --server

    Test if wallet is encrypted:

    /src/bitcoin-cli -rpcwallet=wallet1 --regtest keypoolrefill
    error code: -13
    error message:
    Error: Please enter the wallet passphrase with walletpassphrase first.
    

    Encrypt wallet2: ./src/bitcoin-cli -rpcwallet=wallet2 --regtest encryptwallet test (Core stops at this point)

    Start again: ./src/qt/bitcoin-qt --regtest --wallet=wallet1 --wallet=wallet2 --server

    Test if wallet is encrypted:

    /src/bitcoin-cli -rpcwallet=wallet2 --regtest keypoolrefill
    error code: -13
    error message:
    Error: Please enter the wallet passphrase with walletpassphrase first.
    
  7. juestr commented at 12:53 AM on November 1, 2017: none

    Oh yes wallet encryption works fine.

    The problem (far minor) is that the output of bitcoin-cli help is sensitive to whether the first wallet is encrypted. It will not show the encryptwallet command, except if you use bitcoin-cli -rpcwallet=wallet2.dat help.

    I don't think this magic is beneficial any more, at least it caused me quite a bit of head scratching.

    Note also that all wallet commands require an explicit -rpcwallet when multi wallets are used, but help quietly assumes the default one.

  8. jonasschnelli commented at 6:34 AM on November 1, 2017: contributor

    Oh. I see now. Thanks for the report... a fix is proposed in #11590.

  9. juestr commented at 10:28 AM on November 1, 2017: none

    Thanks

  10. MarcoFalke closed this on Nov 2, 2017

  11. MarcoFalke referenced this in commit bfb270acfa on Nov 2, 2017
  12. codablock referenced this in commit 6efad6f46d on Sep 26, 2019
  13. codablock referenced this in commit 18f104b97e on Sep 30, 2019
  14. barrystyle referenced this in commit c3b6f87941 on Jan 22, 2020
  15. MarcoFalke locked this on Sep 8, 2021

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-13 15:15 UTC

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