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/sign.cpp | |
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/sign.cpp')
-rw-r--r-- | src/script/sign.cpp | 8 |
1 files changed, 1 insertions, 7 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; } |