Refactor script validation to observe amounts

This is a preparation for BIP143 support.

Edited for Zcash merge by Ariel Gabizon.
This commit is contained in:
Pieter Wuille
2016-03-31 14:51:29 +02:00
committed by Jack Grigg
parent ffda7e01a5
commit 2d42e1a993
14 changed files with 49 additions and 37 deletions

View File

@@ -1726,7 +1726,7 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
bool CScriptCheck::operator()() {
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
if (!VerifyScript(scriptSig, scriptPubKey, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, cacheStore), &error)) {
if (!VerifyScript(scriptSig, scriptPubKey, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, amount, cacheStore), &error)) {
return ::error("CScriptCheck(): %s:%d VerifySignature failed: %s", ptxTo->GetHash().ToString(), nIn, ScriptErrorString(error));
}
return true;