diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2018-05-17 17:54:18 -0700 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2018-05-18 11:08:13 -0700 |
commit | 6aa33feadbe11bfa505a80a691d84db966aca134 (patch) | |
tree | 0281e621d6958cbb645b5bfa498092687e2492c6 /src/script | |
parent | 1b53e4f67c6dbefadbfda7e40948840fe2b9da48 (diff) |
Drop UpdateTransaction in favor of UpdateInput
Updating the input explicitly requires the caller to present a mutable
input, which more clearly communicates the effects and intent of the method.
In most cases, this input is already immediately available and need not be
looked up.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/sign.cpp | 8 | ||||
-rw-r--r-- | src/script/sign.h | 1 |
2 files changed, 1 insertions, 8 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index ac35f17f3e..35cb80aead 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -199,12 +199,6 @@ void UpdateInput(CTxIn& input, const SignatureData& data) input.scriptWitness = data.scriptWitness; } -void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data) -{ - assert(tx.vin.size() > nIn); - UpdateInput(tx.vin[nIn], data); -} - bool SignSignature(const SigningProvider &provider, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType) { assert(nIn < txTo.vin.size()); @@ -214,7 +208,7 @@ bool SignSignature(const SigningProvider &provider, const CScript& fromPubKey, C SignatureData sigdata; bool ret = ProduceSignature(provider, creator, fromPubKey, sigdata); - UpdateTransaction(txTo, nIn, sigdata); + UpdateInput(txTo.vin.at(nIn), sigdata); return ret; } diff --git a/src/script/sign.h b/src/script/sign.h index cf3651c1de..553db07349 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -80,7 +80,6 @@ SignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignature /** Extract signature data from a transaction, and insert it. */ SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn); -void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data); void UpdateInput(CTxIn& input, const SignatureData& data); /* Check whether we know how to sign for an output like this, assuming we |