diff options
| author | Pieter Wuille <[email protected]> | 2016-03-31 14:51:29 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-06-22 15:43:00 +0200 |
| commit | 0ef1dd3e11dd573b6e443852ef0c72e34093ac68 (patch) | |
| tree | 5fb4e54e732902ea296636877f2cd81dfd4f4b29 /src/script/sign.cpp | |
| parent | BIP144: Handshake and relay (receiver side) (diff) | |
| download | discoin-0ef1dd3e11dd573b6e443852ef0c72e34093ac68.tar.xz discoin-0ef1dd3e11dd573b6e443852ef0c72e34093ac68.zip | |
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.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 37b702de1..62d874eed 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); } |