Skip to content

Commit

Permalink
Merge #10694: Remove redundant code in MutateTxSign(CMutableTransacti…
Browse files Browse the repository at this point in the history
…on&, const std::string&)

b1149ee 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
  • Loading branch information
laanwj committed Mar 13, 2018
2 parents 66e9142 + b1149ee commit ae5bcc7
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/bitcoin-tx.cpp
Expand Up @@ -551,7 +551,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
// mergedTx will end up with all the signatures; it
// starts as a clone of the raw tx:
CMutableTransaction mergedTx(txVariants[0]);
bool fComplete = true;
CCoinsView viewDummy;
CCoinsViewCache view(&viewDummy);

Expand Down Expand Up @@ -637,7 +636,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
CTxIn& txin = mergedTx.vin[i];
const Coin& coin = view.AccessCoin(txin.prevout);
if (coin.IsSpent()) {
fComplete = false;
continue;
}
const CScript& prevPubKey = coin.out.scriptPubKey;
Expand All @@ -652,14 +650,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
for (const CTransaction& txv : txVariants)
sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i));
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;
Expand Down

0 comments on commit ae5bcc7

Please sign in to comment.