Allows watch-only imports on locked wallets with importmulti.
Also adds a test.
Fixes #17867.
Allows watch-only imports on locked wallets with importmulti.
Also adds a test.
Fixes #17867.
ACK fea634603f0424d82370f6118602da081740e676
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
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.
Concept ACK
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 + ')'),
@theStack thanks, I applied the diff.
re-ACK 2c03465dfa18ee615f76b6e507a65ef451ce1b7c
re-ACK 2c03465dfa18ee615f76b6e507a65ef451ce1b7c
ACK 2c03465dfa18ee615f76b6e507a65ef451ce1b7c