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/bitcoinconsensus.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/bitcoinconsensus.cpp')
| -rw-r--r-- | src/script/bitcoinconsensus.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp index 5c9e7c0a5..26e7a85b7 100644 --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/bitcoinconsensus.cpp @@ -85,7 +85,8 @@ int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned i // Regardless of the verification result, the tx did not error. set_error(err, bitcoinconsensus_ERR_OK); - return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), nIn < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[nIn].scriptWitness : NULL, flags, TransactionSignatureChecker(&tx, nIn), NULL); + CAmount am(0); + return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), nIn < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[nIn].scriptWitness : NULL, flags, TransactionSignatureChecker(&tx, nIn, am), NULL); } catch (const std::exception&) { return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing } |