diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-01-04 17:31:21 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-01-13 10:20:42 -0500 |
commit | d11a58a2d39b90dfe27d3a696b3977b87d7c8113 (patch) | |
tree | b1954fff1ab41312beccffa6ef5859fffe508df6 /src/script.cpp | |
parent | f290a649f91dca1f8e4fe01e09f20eea2e52cbd8 (diff) |
Remove not-used-anywhere scriptPrereq from SignSignature()
Diffstat (limited to 'src/script.cpp')
-rw-r--r-- | src/script.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/script.cpp b/src/script.cpp index 34872808b3..d0fb8303b2 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1525,7 +1525,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C } -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 @@ bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTrans // 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; } |