Review report

core: PR #36577

1 suggestion

Optional improvements

Link

[suggestion] · Explicit-DEFAULT test does not isolate the PSBT field

Dropping || input.sighash_type from sighash_specified would leave every new assertion passing, although the production check still rejects the case.

Location: src/test/psbt_tests.cpp:364 (head).

Details and suggested fix

Both explicit SIGHASH_DEFAULT assertions also provide the sighash through the options: one passes it directly, and FinalizePSBT forwards the input field as an option. Thus the option alone makes sighash_specified true, so these assertions do not test the field independently. The field matters when PSBT_IN_SIGHASH_TYPE is 0 and the caller supplies no sighash; then a 65-byte SIGHASH_ALL signature must be rejected. Core does not write a 0 sighash field for Taproot inputs, so this case comes from PSBTs created by other software. Keep the FinalizePSBT assertion, then set the field and call SignPSBTInput with .finalize = true but no sighash_type; assert SIGHASH_MISMATCH. This is a regression-test gap only: the production check currently rejects the case, and the uncovered path only refuses a sign or finalize request.


Coverage details