HomePhabricator

Make SignatureData able to store signatures and scripts

Description

Make SignatureData able to store signatures and scripts

Summary:
In addition to having the scriptSig and scriptWitness, have SignatureData
also be able to store just the signatures (pubkeys mapped to sigs) and
scripts (script ids mapped to scripts).

Also have DataFromTransaction be able to extract signatures and scripts
from the scriptSig and scriptWitness of an input to put them in SignatureData.

Adds a new SignatureChecker which takes a SignatureData and puts pubkeys
and signatures into it when it successfully verifies a signature.

Adds a new field in SignatureData which stores whether the SignatureData
was complete. This allows us to also update the scriptSig and
scriptWitness to the final one when updating a SignatureData with another
one.

This is a partial backport of Core PR13425 : https://github.com/bitcoin/bitcoin/pull/13425/commits/0422beb9bdfcd7d1cc095ab681a760d8bc7a1918

Also include a change to the transction validation cache that erroneously resused stale sigdata.

Depends on D4209 and D4203

Test Plan:

make check
./test/functional/test_runner.py

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Andrew Chow <achow101-github@achow101.com>Authored on Jul 4 2018, 00:18
deadalnixCommitted on Oct 4 2019, 21:51
deadalnixPushed on Oct 4 2019, 21:51
Reviewer
Restricted Project
Differential Revision
D4210: Make SignatureData able to store signatures and scripts
Parents
rABCcc48812a9aa4: Drop UpdateTransaction in favor of UpdateInput
Branches
Unknown
Tags
Unknown