Add CMutableTransaction and make CTransaction immutable.

In addition, introduce a cached hash inside CTransaction, to prevent
recalculating it over and over again.
This commit is contained in:
Pieter Wuille
2014-06-07 13:53:27 +02:00
parent 8f59251b83
commit 4949004d68
19 changed files with 181 additions and 106 deletions

View File

@@ -36,9 +36,9 @@ BOOST_AUTO_TEST_CASE(pmt_test1)
// build a block with some dummy transactions
CBlock block;
for (unsigned int j=0; j<nTx; j++) {
CTransaction tx;
CMutableTransaction tx;
tx.nLockTime = rand(); // actual transaction data doesn't matter; just make the nLockTime's unique
block.vtx.push_back(tx);
block.vtx.push_back(CTransaction(tx));
}
// calculate actual merkle root and height