From 2b23a87599b7d28e86ca193e7b52f429bcdf144f Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 18 Jul 2014 17:48:00 +0200 Subject: Don't pass nHashType to VerifyScript --- src/script/interpreter.cpp | 9 ++++----- src/script/interpreter.h | 2 +- src/script/sign.cpp | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/script') diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 4f4fdb6b7..0b3d63e5d 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1006,15 +1006,14 @@ bool CheckSig(vector vchSig, const vector &vchPubK return true; } -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, - unsigned int flags, int nHashType) +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) { vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, txTo, nIn, flags, nHashType)) + if (!EvalScript(stack, scriptSig, txTo, nIn, flags, 0)) return false; if (flags & SCRIPT_VERIFY_P2SH) stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, nHashType)) + if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, 0)) return false; if (stack.empty()) return false; @@ -1037,7 +1036,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); popstack(stackCopy); - if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, nHashType)) + if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, 0)) return false; if (stackCopy.empty()) return false; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 0c6f8b9d1..ca57387a1 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -40,6 +40,6 @@ bool IsCanonicalSignature(const std::vector &vchSig, unsigned int uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags); #endif diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 958177de3..7037193b9 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -123,7 +123,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutabl } // Test solution - return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0); + return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS); } bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) -- cgit v1.2.3