#14075 added a keypool
param to importmulti
which imports public keys into the keypool, but this was restricted to watch-only wallets (wallets created with disable_private_keys
).
This PR relaxes that constraint to also allow private keys.
This is a step towards #14449, being able to import any BIP44/49/84 compatible external wallet. Once imported it’s not safe to go back though, because the getnewaddress
command is unaware of the intended address type. For that to really work we either need descriptor based wallets, or import could descriptors as metadata to individual keys in the wallet and make the wallet enforce those when generating a new (change) address.
This also enables me to write a test in #14912 which creates an unsigned PSBT in a wallet without private keys and then signs it in a wallet with those private keys (which simulates an external hardware wallet). There are probably other ways I can build that test though.