From 8b5ef2793748065727a9a2498805ae5b269dcb4f Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 28 Jun 2018 18:56:34 -0700 Subject: SignPSBTInput wrapper function The SignPSBTInput function takes a PSBTInput, SignatureData, SigningProvider, and other data necessary for signing. It fills the SignatureData with data from the PSBTInput, retrieves the UTXO from the PSBTInput, signs and finalizes the input if possible, and then extracts the results from the SignatureData and puts them back into the PSBTInput. --- src/script/sign.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/script/sign.h') diff --git a/src/script/sign.h b/src/script/sign.h index ab2153e3b9..9f0382e257 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -634,6 +634,9 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato bool SignSignature(const SigningProvider &provider, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType); bool SignSignature(const SigningProvider &provider, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType); +/** Signs a PSBTInput */ +bool SignPSBTInput(const SigningProvider& provider, const CMutableTransaction& tx, PSBTInput& input, SignatureData& sigdata, int index, int sighash = 1); + /** Extract signature data from a transaction input, and insert it. */ SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn, const CTxOut& txout); void UpdateInput(CTxIn& input, const SignatureData& data); -- cgit v1.2.3