importmulti does not allow watchonly imports while wallet is locked #17867

issue kristapsk opened this issue on January 4, 2020
  1. kristapsk commented at 7:57 AM on January 4, 2020: contributor

    This differs from behaviour of importaddress where it works.

    $ bitcoin-cli importaddress "<address>" "<label>" false
    

    vs

    $ bitcoin-cli importmulti '[{ "scriptPubKey": { "address": "<address>" }, "timestamp":0, "label": "<label>", "watchonly": true }]' '{ "rescan": false }'
    error code: -13
    error message:
    Error: Please enter the wallet passphrase with walletpassphrase first.
    
  2. kristapsk added the label Bug on Jan 4, 2020
  3. fanquake added the label RPC/REST/ZMQ on Jan 4, 2020
  4. jonasschnelli commented at 9:17 PM on January 5, 2020: contributor

    Should maybe be fixed. The questions for me are:

    a) Do users think the imported addresses/pubkeys-sscripts are encrypted when encrypting the wallet (they are not)?

    b) should encouraging mixed wallets (watch-onlys & private keys) be avoided?

  5. kristapsk commented at 8:09 PM on January 8, 2020: contributor

    Yes, I wasn't sure is it a bug or feature of importmulti. In any case, importmulti and importaddress / importpubkey should behave the same way.

    a) Do users think the imported addresses/pubkeys-sscripts are encrypted when encrypting the wallet (they are not)?

    Why should they think so? You can view addresses, coins, tx history, generate new addresses without unlocking wallet.

    b) should encouraging mixed wallets (watch-onlys & private keys) be avoided?

    It's kinda simple now with multiwallet support. OTOH, I could imagine some people might want to see on the same screen their hot wallet balance together with watch-only cold storage, for example. Mixed wallet allows that. Kinda similar how some banks in Europe now allow to view account balance from your accounts in other banks in the Internet banking website. And I don't see any security risks or other problems this could cause.

  6. promag commented at 11:39 AM on January 9, 2020: member

    Maybe EnsureWalletIsUnlocked should be deferred to the point it's needed?

  7. achow101 closed this on Sep 20, 2022

  8. sidhujag referenced this in commit 9d8d4380e3 on Sep 20, 2022
  9. bitcoin locked this on Sep 20, 2023

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:14 UTC

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