diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-04-25 11:29:18 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-05-26 13:27:50 -0700 |
commit | d342424301013ec47dc146a4beb49d5c9319d80a (patch) | |
tree | 00574e5165c4b96167009fefe525b024e98eae0f /src/test | |
parent | 7e0032290669fae5f52c256856c53038511c7db4 (diff) |
Remove/ignore tx version in utxo and undo
This makes the following changes:
* In undo data and the chainstate database, the transaction nVersion
field is removed from the data structures, always written as 0, and
ignored when reading.
* The definition of hash_serialized in gettxoutsetinfo is changed to no
longer incude the nVersion field. It is renamed to hash_serialized_2
to avoid confusion. The new definition also includes transaction
height and coinbase information, as this information was missing
before.
This depends on having a CHashVerifier-based undo data checksum
verifier.
Apart from changing the definition of serialized_hash, downgrading
after using this patch is supported, as no release ever used the value
of nVersion field in UTXO entries.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/coins_tests.cpp | 4 | ||||
-rw-r--r-- | src/test/transaction_tests.cpp | 1 |
2 files changed, 0 insertions, 5 deletions
diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 1b5d8e91b5..3735f6c868 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -142,7 +142,6 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test) } else { updated_an_entry = true; } - coins.nVersion = insecure_rand(); coins.vout.resize(1); coins.vout[0].nValue = insecure_rand(); *entry = coins; @@ -436,7 +435,6 @@ BOOST_AUTO_TEST_CASE(ccoins_serialization) CDataStream ss1(ParseHex("0104835800816115944e077fe7c803cfa57f29b36bf87c1d358bb85e"), SER_DISK, CLIENT_VERSION); CCoins cc1; ss1 >> cc1; - BOOST_CHECK_EQUAL(cc1.nVersion, 1); BOOST_CHECK_EQUAL(cc1.fCoinBase, false); BOOST_CHECK_EQUAL(cc1.nHeight, 203998); BOOST_CHECK_EQUAL(cc1.vout.size(), 2); @@ -449,7 +447,6 @@ BOOST_AUTO_TEST_CASE(ccoins_serialization) CDataStream ss2(ParseHex("0109044086ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4eebbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa486af3b"), SER_DISK, CLIENT_VERSION); CCoins cc2; ss2 >> cc2; - BOOST_CHECK_EQUAL(cc2.nVersion, 1); BOOST_CHECK_EQUAL(cc2.fCoinBase, true); BOOST_CHECK_EQUAL(cc2.nHeight, 120891); BOOST_CHECK_EQUAL(cc2.vout.size(), 17); @@ -468,7 +465,6 @@ BOOST_AUTO_TEST_CASE(ccoins_serialization) CDataStream ss3(ParseHex("0002000600"), SER_DISK, CLIENT_VERSION); CCoins cc3; ss3 >> cc3; - BOOST_CHECK_EQUAL(cc3.nVersion, 0); BOOST_CHECK_EQUAL(cc3.fCoinBase, false); BOOST_CHECK_EQUAL(cc3.nHeight, 0); BOOST_CHECK_EQUAL(cc3.vout.size(), 1); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 67610301d7..ef2e695ee3 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -471,7 +471,6 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction) { threadGroup.create_thread(boost::bind(&CCheckQueue<CScriptCheck>::Thread, boost::ref(scriptcheckqueue))); CCoins coins; - coins.nVersion = 1; coins.fCoinBase = false; for(uint32_t i = 0; i < mtx.vin.size(); i++) { CTxOut txout; |