Files
bitcoin/src
Ava Chow 1be688f575 Merge bitcoin/bitcoin#32682: wallet: have external signer use PSBT error code EXTERNAL_SIGNER_NOT_FOUND
9dfc61d95f test: detect no external signer connected (Sjors Provoost)
0a4ee93529 wallet: use PSBTError::EXTERNAL_SIGNER_NOT_FOUND (Sjors Provoost)
8ba2f9b7c8 refactor: use util::Result for GetExternalSigner() (Sjors Provoost)

Pull request description:

  When attempting to sign a transaction involving an external signer, if the device isn't connected we throw an `std::runtime_error`. This prevents the (mainly GUI) code that's actually supposed to handle this case from running.

  This PR returns a `PSBTError::EXTERNAL_SIGNER_NOT_FOUND` instead of throwing.

  The first commit is a refactor to have `GetExternalSigner()` return a `util::Result<ExternalSigner>` so the caller can decide how to handle the error. There are two other places where call `GetExternalSigner()` which this PR doesn't change (which I think is fine there).

  Before:
  ![before](https://github.com/user-attachments/assets/2e08863b-fe76-479f-9cc0-60571b357a27)

  After (the translation already exist):
  ![after](https://github.com/user-attachments/assets/0e91c7ed-7d44-4030-beec-20d1694c270c)

  Fixes #32426

  Additionally use `LogWarning` instead of `std::cerr` for both a missing signer and failure to sign.

ACKs for top commit:
  achow101:
    ACK 9dfc61d95f
  brunoerg:
    code review ACK 9dfc61d95f

Tree-SHA512: 22515f4f0b4f50cb0ef532b729e247f11a68be9c90e384942d4277087b2e76806a1cdaa57fb51d5883dacf0a428e5279674aab37cce8c0d3d7de0f96346b8233
2025-06-16 17:32:57 -07:00
..
2025-05-08 16:49:58 +01:00
2025-05-14 14:00:43 -07:00
2025-05-19 16:40:33 +01:00
2025-05-19 16:40:33 +01:00
2025-03-13 11:13:13 +00:00
2025-05-20 09:30:41 +01:00
2025-05-19 16:40:33 +01:00
2025-05-06 12:21:32 -07:00
2025-05-19 16:40:33 +01:00
2025-06-03 08:09:21 +01:00
2025-05-08 16:49:58 +01:00
2025-06-03 08:09:28 +01:00
2025-05-19 16:40:33 +01:00
2025-04-09 15:59:59 +01:00
2025-04-09 15:59:59 +01:00