SignPSBTInput() assumes SIGHASH_DEFAULT for a taproot input when neither PSBT_IN_SIGHASH_TYPE nor the caller's sighash_type is set. Its check of existing signatures then rejected every 65-byte taproot signature, so a PSBT holding a valid SIGHASH_ALL signature could be neither finalized nor signed further.
When neither the field nor the parameter is set, the default is only assumed, so also accept a 65-byte signature ending in SIGHASH_ALL. NONE, SINGLE and ANYONECANPAY variants are still rejected, as are all mismatches when the field or the parameter is set.
Fixes #36507.
🤖 Generated with Claude Code