Summary
Fixes #32849 - Replace CHECK_NONFATAL
with proper error handling in descriptorprocesspsbt
RPC to prevent internal bug assertions when encountering invalid Schnorr signatures.
Problem
When descriptorprocesspsbt
encounters a PSBT with invalid signatures (e.g., invalid Schnorr signatures with SIGHASH_SINGLE | ANYONECANPAY flags), it triggers an internal bug assertion instead of returning a user-friendly error message.
Solution
Replace the CHECK_NONFATAL(FinalizeAndExtractPSBT(psbtx_copy, mtx))
call with proper error handling that throws a JSONRPCError
with a clear message.
Testing
- Reproduced the bug with Bitcoin Core v29.0.0
- Verified the fix returns proper error messages instead of crashing
- Tested with the exact PSBT from the issue report
Changes
src/rpc/rawtransaction.cpp
: Replace CHECK_NONFATAL with if-statement and JSONRPCError