The bitcoin-cli help states that for each "prevtxs", "amount" is a required field. When I use signrawtransaction to do an offline signing of a segwit spend, if I omit this field, instead of an error message, I get an invalid signature.
Expected behavior
When I omit the required "amount" field, I expect bitcoin-cli to report an error message. (Perhaps, for backward compatibility, it should only be an error if the amount is actually used in the signature calculation.)
Actual behavior
I get a complete, apparently good transaction, but when I attempt to broadcast it using sendrawtransaction, I get the following error:
64: non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code -26)
When I include amount, I get a good transaction that differs only in the witness signatures for this input.
To reproduce
I'm running on my own Linux build of Bitcoin Core from tag v0.16.0rc3.
This script shows the issue [output]. The first call to signrawtransaction is missing the amount.