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

@@ -85,7 +85,8 @@ int zcashconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int
// Regardless of the verification result, the tx did not error.
set_error(err, zcashconsensus_ERR_OK);
return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), flags, TransactionSignatureChecker(&tx, nIn), NULL);
CAmount am(0);
return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), flags, TransactionSignatureChecker(&tx, nIn, am), NULL);
} catch (const std::exception&) {
return set_error(err, zcashconsensus_ERR_TX_DESERIALIZE); // Error deserializing
}