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.
This commit is contained in:
Ben Woosley
2018-05-17 17:54:18 -07:00
parent 1b53e4f67c
commit 6aa33feadb
7 changed files with 14 additions and 21 deletions

View File

@@ -748,7 +748,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request)
}
}
UpdateTransaction(mergedTx, i, sigdata);
UpdateInput(txin, sigdata);
}
return EncodeHexTx(mergedTx);
@@ -882,7 +882,7 @@ UniValue SignTransaction(CMutableTransaction& mtx, const UniValue& prevTxsUnival
}
sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(mtx, i));
UpdateTransaction(mtx, i, sigdata);
UpdateInput(txin, sigdata);
ScriptError serror = SCRIPT_ERR_OK;
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) {