Mercurial > hg > bitcoin
diff src/script.cpp @ 1751:ec000d0b853b draft
Remove not-used-anywhere scriptPrereq from SignSignature()
author | Gavin Andresen <gavinandresen@gmail.com> |
---|---|
date | Wed, 04 Jan 2012 17:31:21 -0500 |
parents | 768b5a7944f0 |
children | 7b4383bddf3b |
line wrap: on
line diff
--- a/src/script.cpp +++ b/src/script.cpp @@ -1525,7 +1525,7 @@ } -bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType, CScript scriptPrereq) +bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType) { assert(nIn < txTo.vin.size()); CTxIn& txin = txTo.vin[nIn]; @@ -1534,18 +1534,15 @@ // Leave out the signature from the hash, since a signature can't sign itself. // The checksig op will also drop the signatures from its hash. - uint256 hash = SignatureHash(scriptPrereq + txout.scriptPubKey, txTo, nIn, nHashType); + uint256 hash = SignatureHash(txout.scriptPubKey, txTo, nIn, nHashType); if (!Solver(keystore, txout.scriptPubKey, hash, nHashType, txin.scriptSig)) return false; - txin.scriptSig = scriptPrereq + txin.scriptSig; - // Test solution int nUnused = 0; - if (scriptPrereq.empty()) - if (!VerifyScript(txin.scriptSig, txout.scriptPubKey, txTo, nIn, nUnused, 0, true)) - return false; + if (!VerifyScript(txin.scriptSig, txout.scriptPubKey, txTo, nIn, nUnused, 0, true)) + return false; return true; }