If there are any script verification errors, when using signrawtransaction, they are shown in the RPC result.
Example:
./bitcoin-cli "signrawtransaction" "0100000002d8fde545ff10eec10a6bef0c293c892b556aaa8c9e2f5f4c8545ca5c88e41c930100000000ffffffff62a717b7379c9fd900bf8cd42d6cbe1992f51aac2edff637dd291ec0b710acf23800000000ffffffff01a0410000000000001976a9142d0242ee11731e1fb95f3917b61a11aa400f6d5388ac00000000" "[{\"txid\":\"931ce4885cca45854c5f2f9e8caa6a552b893c290cef6b0ac1ee10ff45e5fdd8\",\"vout\":1,\"scriptPubKey\":\"512102a6bce06d76dfa05974f50e71660936966be40fceee99fed481a526016b3b240e21160000000100000001d865ecba07d000000000000000000000000000000000000052ae\"},{\"txid\":\"f2ac10b7c01e29dd37f6df2eac1af59219be6c2dd48cbf00d99f9c37b717a762\",\"vout\":56,\"scriptPubKey\":\"01\"}]" "[\"xxxxxx\"]"
{
"hex" : "0100000002d8fde545ff10eec10a6bef0c293c892b556aaa8c9e2f5f4c8545ca5c88e41c93010000004a00483045022100f5e5d54c229c241c8525a9e01c9774d0cf974f2262a7045636c2308dbae43af90220151439bb3913379327fcf10ee51b779f9b349c58870962a605276419122a2fb601ffffffff62a717b7379c9fd900bf8cd42d6cbe1992f51aac2edff637dd291ec0b710acf23800000000ffffffff01a0410000000000001976a9142d0242ee11731e1fb95f3917b61a11aa400f6d5388ac00000000",
"complete" : false,
"errors" : [
{
"txid" : "931ce4885cca45854c5f2f9e8caa6a552b893c290cef6b0ac1ee10ff45e5fdd8",
"vout" : 1,
"scriptSig" : "00483045022100f5e5d54c229c241c8525a9e01c9774d0cf974f2262a7045636c2308dbae43af90220151439bb3913379327fcf10ee51b779f9b349c58870962a605276419122a2fb601",
"sequence" : 4294967295,
"error" : "Public key is neither compressed or uncompressed"
},
{
"txid" : "f2ac10b7c01e29dd37f6df2eac1af59219be6c2dd48cbf00d99f9c37b717a762",
"vout" : 56,
"scriptSig" : "",
"sequence" : 4294967295,
"error" : "Opcode missing or not understood"
}
]
}
The field errors is currently omitted, if no script verification error occured, but alternatively an empty array could be returned, which might be easier to process, but right now it basically mirrors the behavior of getrawtransaction and others, where some fields are only returned, if available.
This could be perceived as inconsistent, as signrawtransaction also returns actual RPC errors, and not all error descriptions might be intuitive, for example, when partially signing a script-hash transaction, which then results in the message "Operation not valid with the current stack size", but addressing this seemed out of scope of this PR.