HomePhabricator

Make signrawtransaction* give an error when amount is needed but missing

Description

Make signrawtransaction* give an error when amount is needed but missing

Summary:

  • Error on missing amount in signrawtransaction*

Signatures using segregated witness commit to the amount being spent,
so that value must be passed into signrawtransactionwithkey and
signrawtransactionwithwallet. This ensures an error is issued if that
doesn't happen, rather than just assuming the value is 0 and producing
a signature that is almost certainly invalid.

  • [tests] Check signrawtransaction* errors on missing prevtx info

Backport of Core PR13547

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8082

Details

Provenance
Anthony Towns <aj@erisian.com.au>Authored on Jun 27 2018, 07:54
deadalnixCommitted on Oct 23 2020, 14:58
deadalnixPushed on Oct 23 2020, 14:58
Reviewer
Restricted Project
Differential Revision
D8082: Make signrawtransaction* give an error when amount is needed but missing
Parents
rABC9c2f408c3cb4: [backport#16912] doc: Move doxygen intro to file for USE_MDFILE_AS_MANPAGE
Branches
Unknown
Tags
Unknown