Changeset View
Changeset View
Standalone View
Standalone View
src/script/sign.h
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | |||||
typedef std::pair<CPubKey, std::vector<uint8_t>> SigPair; | typedef std::pair<CPubKey, std::vector<uint8_t>> SigPair; | ||||
// This struct contains information from a transaction input and also contains | // This struct contains information from a transaction input and also contains | ||||
// signatures for that input. The information contained here can be used to | // signatures for that input. The information contained here can be used to | ||||
// create a signature and is also filled by ProduceSignature in order to | // create a signature and is also filled by ProduceSignature in order to | ||||
// construct final scriptSigs. | // construct final scriptSigs. | ||||
struct SignatureData { | struct SignatureData { | ||||
/// Stores whether the scriptSig and scriptWitness are complete. | /// Stores whether the scriptSig are complete. | ||||
bool complete = false; | bool complete = false; | ||||
/// The scriptSig of an input. Contains complete signatures or the | /// The scriptSig of an input. Contains complete signatures or the | ||||
/// traditional partial signatures format. | /// traditional partial signatures format. | ||||
CScript scriptSig; | CScript scriptSig; | ||||
/// The redeemScript (if any) for the input. | /// The redeemScript (if any) for the input. | ||||
CScript redeem_script; | CScript redeem_script; | ||||
/// BIP 174 style partial signatures for the input. May contain all | /// BIP 174 style partial signatures for the input. May contain all | ||||
/// signatures necessary for producing a final scriptSig. | /// signatures necessary for producing a final scriptSig. | ||||
▲ Show 20 Lines • Show All 557 Lines • ▼ Show 20 Lines | bool SignSignature(const SigningProvider &provider, const CTransaction &txFrom, | ||||
CMutableTransaction &txTo, unsigned int nIn, | CMutableTransaction &txTo, unsigned int nIn, | ||||
SigHashType sigHashType); | SigHashType sigHashType); | ||||
/** | /** | ||||
* Signs a PSBTInput, verifying that all provided data matches what is being | * Signs a PSBTInput, verifying that all provided data matches what is being | ||||
* signed. | * signed. | ||||
*/ | */ | ||||
bool SignPSBTInput(const SigningProvider &provider, | bool SignPSBTInput(const SigningProvider &provider, | ||||
const CMutableTransaction &tx, PSBTInput &input, | const CMutableTransaction &tx, PSBTInput &input, int index, | ||||
SignatureData &sigdata, int index, | |||||
SigHashType sighash = SigHashType()); | SigHashType sighash = SigHashType()); | ||||
/** Extract signature data from a transaction input, and insert it. */ | /** Extract signature data from a transaction input, and insert it. */ | ||||
SignatureData DataFromTransaction(const CMutableTransaction &tx, | SignatureData DataFromTransaction(const CMutableTransaction &tx, | ||||
unsigned int nIn, const CTxOut &txout); | unsigned int nIn, const CTxOut &txout); | ||||
void UpdateInput(CTxIn &input, const SignatureData &data); | void UpdateInput(CTxIn &input, const SignatureData &data); | ||||
#endif // BITCOIN_SCRIPT_SIGN_H | #endif // BITCOIN_SCRIPT_SIGN_H |