From 6aa33feadbe11bfa505a80a691d84db966aca134 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Thu, 17 May 2018 17:54:18 -0700 Subject: 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. --- src/script/sign.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/script/sign.cpp') 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; } -- cgit v1.2.3