aboutsummaryrefslogtreecommitdiff
path: root/src/script/sign.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-03-31 14:51:29 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-22 15:43:00 +0200
commit0ef1dd3e11dd573b6e443852ef0c72e34093ac68 (patch)
tree5fb4e54e732902ea296636877f2cd81dfd4f4b29 /src/script/sign.cpp
parentb8a97498df1e83f8dcc49bc3fa4344f9e9799242 (diff)
downloadbitcoin-0ef1dd3e11dd573b6e443852ef0c72e34093ac68.tar.xz
Refactor script validation to observe amounts
This is a preparation for BIP143 support.
Diffstat (limited to 'src/script/sign.cpp')
-rw-r--r--src/script/sign.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index 37b702de17..62d874eed4 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -18,7 +18,8 @@ using namespace std;
typedef std::vector<unsigned char> valtype;
-TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), checker(txTo, nIn) {}
+static const CAmount amountZero = 0;
+TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), checker(txTo, nIn, amountZero) {}
bool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& address, const CScript& scriptCode) const
{
@@ -258,7 +259,7 @@ static CScript CombineSignatures(const CScript& scriptPubKey, const BaseSignatur
CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const CScript& scriptSig1, const CScript& scriptSig2)
{
- TransactionSignatureChecker checker(&txTo, nIn);
+ TransactionSignatureChecker checker(&txTo, nIn, amountZero);
return CombineSignatures(scriptPubKey, checker, scriptSig1, scriptSig2);
}