Allow only a single -usewallet argument #10867

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2017/07/multiwallet_bitcoincli changing 1 files +5 −1
  1. jonasschnelli commented at 3:59 pm on July 18, 2017: contributor

    Currently, one can specify multiple -usewallet arguments in bitcoin-cli (Including bitcoin.conf) where the last passed-in -usewallet will be used. This can result in executing critical actions on the wrong wallet.

    This PR halts bitcoin-cli if multiple -usewallet-arguments where passed-in.

    Tagged for 0.15 (in case we consider this a bug-fix).

    Reported by @morcos (https://github.com/bitcoin/bitcoin/pull/10849#issuecomment-316065717)

  2. Allow only a single -usewallet argument 23d3789f6f
  3. jonasschnelli added this to the milestone 0.15.0 on Jul 18, 2017
  4. jonasschnelli added the label Wallet on Jul 18, 2017
  5. jnewbery commented at 1:46 pm on July 19, 2017: member
    You talk in #10868 about having a default wallet specified in .conf by using -usewallet. I think this PR would mean that if you did have a -usewallet in .conf, then you’d never be able to issue commands to any of the other wallets (since trying to specify a -usewallet override on the command line would trigger your "Only one -usewallet arguments is allowed" throw). Is that the intention?
  6. jonasschnelli commented at 1:51 pm on July 19, 2017: contributor

    You talk in #10868 about having a default wallet specified in .conf by using -usewallet. I think this PR would mean that if you did have a -usewallet in .conf, then you’d never be able to issue commands to any of the other wallets (since trying to specify a -usewallet override on the command line would trigger your “Only one -usewallet arguments is allowed” throw). Is that the intention?

    Yes. I think that would make sense. If a user defines a default wallet via explicitly place a -usewallet in bitcoin.conf, then rejecting an override via "Only one -usewallet arguments is allowed" seems reasonable. IMO this would be the right level of encourage / discourage to use a default wallet (allow it if you always want to use it, disallow it if you want to mix usage between specifying a wallet and having a default wallet).

  7. jnewbery commented at 1:55 pm on July 19, 2017: member
    In that case, I don’t think this is a useful change. It would mean that users would be able to load a wallet and then not do anything with it. I think it’d be a really frustrating experience to see a wallet loaded by bitcoin, but the only way to access it is to stop the server, change the .conf file and then restart.
  8. jonasschnelli commented at 2:01 pm on July 19, 2017: contributor

    In that case, I don’t think this is a useful change. It would mean that users would be able to load a wallet and then not do anything with it. I think it’d be a really frustrating experience to see a wallet loaded by bitcoin, but the only way to access it is to stop the server, change the .conf file and then restart.

    Not sure if I am wrong, but…

    1. The wallet does also something if you can’t access it via bitcoin-cli, a) it syncs, b) you can access it with other tools (RPC, maybe later Qt).
    2. If you have decided to use a default wallet via -usewallet in your conf, and then want to access other wallets with bitcoin-cli, then just remove -usewallet from the conf (no need to restart the server). This seems to be the right level of encourage/discourage for the using a default wallet.
  9. jnewbery commented at 2:31 pm on July 19, 2017: member
    Yes, you’re right. You can do this by changing .conf without restarting bitcoind, although I think that generally people shouldn’t do that. Having inconsistent .conf/running config can be confusing.
  10. morcos commented at 3:39 pm on July 19, 2017: member
    Prefer #10868
  11. jonasschnelli commented at 7:50 pm on July 19, 2017: contributor
    Closing. Either we do that globally or not.
  12. jonasschnelli closed this on Jul 19, 2017

  13. DrahtBot locked this on Sep 8, 2021


jonasschnelli jnewbery morcos

Labels
Wallet

Milestone
0.15.0


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-11-18 00:12 UTC

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