Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
A non-watch-only wallet allows to import descriptors with partial
private keys, eg: a multisig descriptor with one private key and
one public key. In case an xpub is imported in any such descriptors
whose private key the wallet doesn’t have, then the gethdkeys RPC
throws an unhandled error like below when the private keys are
requested.
0 ➜ bitcoincli -named gethdkeys private=true
1 error code: -1
2 error message:
3 map::at: key not found
Expected behaviour
The RPC should properly handle the request and not throw.
Steps to reproduce
- Create a non watch only wallet.
- Call
importdescriptorsRPC with partial private keys, eg:
0[{'desc': 'wsh(multi(2,tprv8ZgxMBicQKsPdaTnUf1FUTUtnupv4pHiwFLsVHPnNHhJtACT3sdj7eMRx1ixLchduVUD4XQzN5qNyZri9NYkrS4kt4tvgyhnW7byhxHzSHw/*,tpubD6NzVbkrYhZ4WzibfNc8tzv6GtMzQ4LnP5YRgM8X5Dia9iPdBdrx3QujdD9fzkwxnGQaBh3q4eFENqJxr8Fzj9bNZhwGndoWJgQQeKTNRWE/*))#m5xlzyqz', 'timestamp': 'now'}]
- Call
gethdkeysRPC.
0bitcoincli -named gethdkeys private=true
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
master@d7fd8c6952f288685bf16151b6c1139aad74ffea
Operating system and version
MacOS
Machine specifications
No response