rpc: Allow importmulti watchonly imports with locked wallet #26116

pull aureleoules wants to merge 2 commits into bitcoin:master from aureleoules:2022-09-import-watchonly-locked changing 2 files +31 −1
  1. aureleoules commented at 8:28 PM on September 17, 2022: member

    Allows watch-only imports on locked wallets with importmulti. Also adds a test.

    Fixes #17867.

  2. rpc: Allow importmulti watchonly imports with locked wallet 1fcf9e6e81
  3. aureleoules force-pushed on Sep 17, 2022
  4. DrahtBot added the label RPC/REST/ZMQ on Sep 17, 2022
  5. kristapsk approved
  6. kristapsk commented at 8:03 AM on September 18, 2022: contributor

    ACK fea634603f0424d82370f6118602da081740e676

  7. DrahtBot commented at 10:36 AM on September 18, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22838 (descriptors: Be able to specify change and receiving in a single descriptor string by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. theStack commented at 3:17 PM on September 18, 2022: contributor

    Concept ACK

  9. theStack approved
  10. theStack commented at 10:26 AM on September 19, 2022: contributor

    Code-review ACK fea634603f0424d82370f6118602da081740e676

    Could also add a test checking that the RPC still throws on a locked wallet if there are any non-watchonly imports:

    diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py
    index 0a6cdc290..62a1a3341 100755
    --- a/test/functional/wallet_importmulti.py
    +++ b/test/functional/wallet_importmulti.py
    @@ -878,6 +878,12 @@ class ImportMultiTest(BitcoinTestFramework):
             self.log.info('Test watchonly imports on a wallet with a passphrase, without unlocking')
             self.nodes[1].createwallet(wallet_name='w1', blank=True, passphrase='pass')
             wrpc = self.nodes[1].get_wallet_rpc('w1')
    +        assert_raises_rpc_error(-13, "Please enter the wallet passphrase with walletpassphrase first.",
    +                                wrpc.importmulti, [{
    +                                    'desc': descsum_create('wpkh(' + pub1 + ')'),
    +                                    "timestamp": "now",
    +                                }])
    +
             result = wrpc.importmulti(
                 [{
                     'desc': descsum_create('wpkh(' + pub1 + ')'),
    
  11. test: Test watchonly imports with passphrase-locked wallet 2c03465dfa
  12. aureleoules force-pushed on Sep 19, 2022
  13. aureleoules commented at 11:56 AM on September 19, 2022: member

    @theStack thanks, I applied the diff.

  14. kristapsk approved
  15. kristapsk commented at 12:01 PM on September 19, 2022: contributor

    re-ACK 2c03465dfa18ee615f76b6e507a65ef451ce1b7c

  16. theStack approved
  17. theStack commented at 12:02 PM on September 19, 2022: contributor

    re-ACK 2c03465dfa18ee615f76b6e507a65ef451ce1b7c

  18. maflcko added the label Wallet on Sep 19, 2022
  19. maflcko requested review from achow101 on Sep 20, 2022
  20. achow101 commented at 3:54 PM on September 20, 2022: member

    ACK 2c03465dfa18ee615f76b6e507a65ef451ce1b7c

  21. achow101 merged this on Sep 20, 2022
  22. achow101 closed this on Sep 20, 2022

  23. sidhujag referenced this in commit 9d8d4380e3 on Sep 20, 2022
  24. aureleoules deleted the branch on Nov 2, 2022
  25. bitcoin locked this on Nov 2, 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:13 UTC

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