Files
bitcoin/src/wallet/rpc
Ava Chow 8cc690ea9b Merge bitcoin/bitcoin#34379: wallet: fix gethdkeys RPC for descriptors with partial xprvs
43c528aba9 wallet, test: update `gethdkeys` functional test (rkrux)
6e3a0afc2f wallet: fix `gethdkeys` RPC for descriptors with partial xprvs (rkrux)

Pull request description:

  Fixes #34378

  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.

  This fix ensures that such calls are properly handled by conditionally finding the corresponding xprv and the related functional test is accordingly updated.

  ```
  ➜ bitcoincli -named gethdkeys private=true
  error code: -1
  error message:
  map::at:  key not found
  ```

ACKs for top commit:
  achow101:
    ACK 43c528aba9
  w0xlt:
    ACK 43c528aba9
  Eunovo:
    Tested ACK 43c528aba9

Tree-SHA512: 106e02ee368a3fa94d116f54f2fa71f9886e4753e331b91ce13a346559d5497ef6cd7ddaa8736fcfe1a7ac427a44d647fb75e523eb72f917fa866adbe0dbad30
2026-04-01 14:32:49 -07:00
..