Summary
This PR fixes issue #33320 by adding explicit validation for invalid taproot key path signatures in the analyzepsbt
RPC command.
Problem
Currently, when a PSBT contains an invalid taproot_key_path_sig
, analyzepsbt
returns a confusing status of "next": "updater"
instead of properly reporting the validation error. This can happen when external applications incorrectly construct PSBTs.
Solution
- Added validation in
AnalyzePSBT
to check for invalid taproot key path signatures - Check signature length (must be 64 or 65 bytes for valid Schnorr signatures)
- Return clear error message when signature is invalid
- Added test coverage in
rpc_psbt.py
Testing
- Added functional test that verifies the error is properly reported for PSBTs with invalid taproot signatures
- Existing tests continue to pass
Fixes #33320