aboutsummaryrefslogtreecommitdiff
path: root/src/script/interpreter.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-01-27 09:28:45 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2015-02-02 20:19:12 -0800
commit858809a33e4f690c4ad213f44a6c4465fc2ef025 (patch)
treea7b1dad512fb2040431a92f50b2131c0a872d088 /src/script/interpreter.h
parenta62649731fb1babaedff10b7c0baec4c50c90d60 (diff)
Use separate SignatureChecker for CMutableTransaction
Diffstat (limited to 'src/script/interpreter.h')
-rw-r--r--src/script/interpreter.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/script/interpreter.h b/src/script/interpreter.h
index 8bf379ed89..063a072368 100644
--- a/src/script/interpreter.h
+++ b/src/script/interpreter.h
@@ -7,6 +7,7 @@
#define BITCOIN_SCRIPT_INTERPRETER_H
#include "script_error.h"
+#include "primitives/transaction.h"
#include <vector>
#include <stdint.h>
@@ -90,7 +91,7 @@ public:
virtual ~BaseSignatureChecker() {}
};
-class SignatureChecker : public BaseSignatureChecker
+class TransactionSignatureChecker : public BaseSignatureChecker
{
private:
const CTransaction& txTo;
@@ -100,10 +101,19 @@ protected:
virtual bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const;
public:
- SignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {}
+ TransactionSignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {}
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode) const;
};
+class MutableTransactionSignatureChecker : public TransactionSignatureChecker
+{
+private:
+ const CTransaction txTo;
+
+public:
+ MutableTransactionSignatureChecker(const CMutableTransaction& txToIn, unsigned int nInIn) : TransactionSignatureChecker(txTo, nInIn), txTo(txToIn) {}
+};
+
bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* error = NULL);
bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* error = NULL);