mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
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:
@@ -629,7 +629,7 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
|
||||
|
||||
// Sign what we can:
|
||||
for (unsigned int i = 0; i < mergedTx.vin.size(); i++) {
|
||||
const CTxIn& txin = mergedTx.vin[i];
|
||||
CTxIn& txin = mergedTx.vin[i];
|
||||
const Coin& coin = view.AccessCoin(txin.prevout);
|
||||
if (coin.IsSpent()) {
|
||||
continue;
|
||||
@@ -644,7 +644,7 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
|
||||
|
||||
// ... and merge in other signatures:
|
||||
sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i));
|
||||
UpdateTransaction(mergedTx, i, sigdata);
|
||||
UpdateInput(txin, sigdata);
|
||||
}
|
||||
|
||||
tx = mergedTx;
|
||||
|
||||
Reference in New Issue
Block a user