Make CTransaction actually immutable

This commit is contained in:
Pieter Wuille
2016-11-11 16:23:17 -08:00
parent 42fd8dee30
commit 81e3228fcb
10 changed files with 132 additions and 141 deletions

View File

@@ -85,8 +85,7 @@ static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptP
}
try {
TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen);
CTransaction tx;
stream >> tx;
CTransaction tx(deserialize, stream);
if (nIn >= tx.vin.size())
return set_error(err, bitcoinconsensus_ERR_TX_INDEX);
if (GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) != txToLen)