From 858809a33e4f690c4ad213f44a6c4465fc2ef025 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 27 Jan 2015 09:28:45 -0400 Subject: Use separate SignatureChecker for CMutableTransaction --- src/script/interpreter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/interpreter.cpp') diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 0cee1a011..b1cf028c5 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1058,12 +1058,12 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig return ss.GetHash(); } -bool SignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash) const +bool TransactionSignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash) const { return pubkey.Verify(sighash, vchSig); } -bool SignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode) const +bool TransactionSignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode) const { CPubKey pubkey(vchPubKey); if (!pubkey.IsValid()) -- cgit v1.2.3 From 9fddceda44fb5592be179d783f0e5ac616c51c0d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 27 Jan 2015 10:01:31 -0400 Subject: Avoid storing a reference passed to SignatureChecker constructors --- src/script/interpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script/interpreter.cpp') diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index b1cf028c5..af7c641c0 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1076,7 +1076,7 @@ bool TransactionSignatureChecker::CheckSig(const vector& vchSigIn int nHashType = vchSig.back(); vchSig.pop_back(); - uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); + uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType); if (!VerifySignature(vchSig, pubkey, sighash)) return false; -- cgit v1.2.3