Changeset View
Changeset View
Standalone View
Standalone View
src/script/bitcoinconsensus.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static int verify_script(const uint8_t *scriptPubKey, | ||||
} | } | ||||
try { | try { | ||||
TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen); | TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen); | ||||
CTransaction tx(deserialize, stream); | CTransaction tx(deserialize, stream); | ||||
if (nIn >= tx.vin.size()) { | if (nIn >= tx.vin.size()) { | ||||
return set_error(err, bitcoinconsensus_ERR_TX_INDEX); | return set_error(err, bitcoinconsensus_ERR_TX_INDEX); | ||||
} | } | ||||
if (GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) != txToLen) { | if (GetSerializeSize(tx, PROTOCOL_VERSION) != txToLen) { | ||||
return set_error(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH); | return set_error(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH); | ||||
} | } | ||||
// Regardless of the verification result, the tx did not error. | // Regardless of the verification result, the tx did not error. | ||||
set_error(err, bitcoinconsensus_ERR_OK); | set_error(err, bitcoinconsensus_ERR_OK); | ||||
PrecomputedTransactionData txdata(tx); | PrecomputedTransactionData txdata(tx); | ||||
return VerifyScript( | return VerifyScript( | ||||
Show All 36 Lines |