Merge #10694: Remove redundant code in MutateTxSign(CMutableTransaction&, const std::string&)

b1149ee4c Remove redundant code in MutateTxSign(CMutableTransaction&, const std::string&) (practicalswift)

Pull request description:

  Remove redundant code in `MutateTxSign(CMutableTransaction&, const std::string&)`.

Tree-SHA512: 0f0aba4def18b9a4ca73f2bd676881bc05d852d1d34b564416b2b979056263e5471c5d8ce743af44ef6bce11d77b74d18151c983b735cdf47c36f6591ab4b3fb
This commit is contained in:
Wladimir J. van der Laan 2018-03-13 16:25:50 +01:00
commit ae5bcc7abb
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D

View file

@ -551,7 +551,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
// mergedTx will end up with all the signatures; it // mergedTx will end up with all the signatures; it
// starts as a clone of the raw tx: // starts as a clone of the raw tx:
CMutableTransaction mergedTx(txVariants[0]); CMutableTransaction mergedTx(txVariants[0]);
bool fComplete = true;
CCoinsView viewDummy; CCoinsView viewDummy;
CCoinsViewCache view(&viewDummy); CCoinsViewCache view(&viewDummy);
@ -637,7 +636,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
CTxIn& txin = mergedTx.vin[i]; CTxIn& txin = mergedTx.vin[i];
const Coin& coin = view.AccessCoin(txin.prevout); const Coin& coin = view.AccessCoin(txin.prevout);
if (coin.IsSpent()) { if (coin.IsSpent()) {
fComplete = false;
continue; continue;
} }
const CScript& prevPubKey = coin.out.scriptPubKey; const CScript& prevPubKey = coin.out.scriptPubKey;
@ -652,14 +650,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
for (const CTransaction& txv : txVariants) for (const CTransaction& txv : txVariants)
sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i)); sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i));
UpdateTransaction(mergedTx, i, sigdata); UpdateTransaction(mergedTx, i, sigdata);
if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i, amount)))
fComplete = false;
}
if (fComplete) {
// do nothing... for now
// perhaps store this for later optional JSON output
} }
tx = mergedTx; tx = mergedTx;