Adding support for “witnessScript” as an alternative to “redeemScript” when using “signrawtransactionwithkey” meant that the RPCTypeCheckObj()
call in SignTransaction
can’t error out just because either parameter is missing – it’s only a problem if both are missing, which isn’t a state RPCTypeCheckObj()
tests for. This results in the regression described in #16249. This patch adds some code to test for this case and give a similar error, namely:
error code: -8
error message:
Missing redeemScript/witnessScript
Fixes: #16249