diff options
author | Andrew Chow <achow101-github@achow101.com> | 2018-03-05 16:37:24 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2018-03-09 21:15:36 -0500 |
commit | 12ec29d3bb0d46c61712210fe9bb96a0d543204a (patch) | |
tree | 5570d616050510641d8f55d894da60048841e6cf /src/script/sign.cpp | |
parent | a34ac6ae0788b50e12dd2c8ac59dbda2a03a3c2e (diff) |
Calculate and store the number of bytes required to spend an input
Diffstat (limited to 'src/script/sign.cpp')
-rw-r--r-- | src/script/sign.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index aaba5e5926..baa712dc2d 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -194,11 +194,16 @@ SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nI return data; } +void UpdateInput(CTxIn& input, const SignatureData& data) +{ + input.scriptSig = data.scriptSig; + input.scriptWitness = data.scriptWitness; +} + void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data) { assert(tx.vin.size() > nIn); - tx.vin[nIn].scriptSig = data.scriptSig; - tx.vin[nIn].scriptWitness = data.scriptWitness; + UpdateInput(tx.vin[nIn], data); } bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType) |