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 struct contains information from a transaction input and also contains signatures for that input.
// The information contained here can be used to create a signature and is also filled by ProduceSignature
// in order to construct final scriptSigs and scriptWitnesses.
structSignatureData{
structSignatureData{
CScriptscriptSig;
boolcomplete=false;///< Stores whether the scriptSig and scriptWitness are complete
CScriptWitnessscriptWitness;
CScriptscriptSig;///< The scriptSig of an input. Contains complete signatures or the traditional partial signatures format
CScriptredeem_script;///< The redeemScript (if any) for the input
CScriptwitness_script;///< The witnessScript (if any) for the input. witnessScripts are used in P2WSH outputs.
CScriptWitnessscriptWitness;///< The scriptWitness of an input. Contains complete signatures or the traditional partial signatures format. scriptWitness is part of a transaction input per BIP 144.
std::map<CKeyID,SigPair>signatures;///< BIP 174 style partial signatures for the input. May contain all signatures necessary for producing a final scriptSig or scriptWitness.