diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-01-27 10:01:31 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-02-03 08:52:13 +0100 |
commit | 2448d34298c12a8ef6e21788db5e70ffb554d8b2 (patch) | |
tree | 4a12aaa3a4a2aee9914660f8478acfd45e999ef8 /src/script/interpreter.h | |
parent | 1bbad80bf4a939bcacd419f19e46a12a5baa6174 (diff) | |
download | bitcoin-2448d34298c12a8ef6e21788db5e70ffb554d8b2.tar.xz |
Avoid storing a reference passed to SignatureChecker constructors
Rebased-From: 9fddceda44fb5592be179d783f0e5ac616c51c0d
Github-Pull: #5719
Diffstat (limited to 'src/script/interpreter.h')
-rw-r--r-- | src/script/interpreter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 7bc919e9fd..83d44a9589 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -88,14 +88,14 @@ public: class TransactionSignatureChecker : public BaseSignatureChecker { private: - const CTransaction& txTo; + const CTransaction* txTo; unsigned int nIn; protected: virtual bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; public: - TransactionSignatureChecker(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; }; @@ -105,7 +105,7 @@ private: const CTransaction txTo; public: - MutableTransactionSignatureChecker(const CMutableTransaction& txToIn, unsigned int nInIn) : TransactionSignatureChecker(txTo, nInIn), txTo(txToIn) {} + 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); |