mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Use replaced transactions in compact block reconstruction
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
std::vector<std::pair<uint256, CTransactionRef>> extra_txn;
|
||||
|
||||
struct RegtestingSetup : public TestingSetup {
|
||||
RegtestingSetup() : TestingSetup(CBaseChainParams::REGTEST) {}
|
||||
};
|
||||
@@ -73,7 +75,7 @@ BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2) == READ_STATUS_OK);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
||||
BOOST_CHECK(!partialBlock.IsTxAvailable(1));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||
@@ -179,7 +181,7 @@ BOOST_AUTO_TEST_CASE(NonCoinbasePreforwardRTTest)
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2) == READ_STATUS_OK);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK(!partialBlock.IsTxAvailable(0));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||
@@ -245,7 +247,7 @@ BOOST_AUTO_TEST_CASE(SufficientPreforwardRTTest)
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2) == READ_STATUS_OK);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||
@@ -300,7 +302,7 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2) == READ_STATUS_OK);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK(partialBlock.IsTxAvailable(0));
|
||||
|
||||
CBlock block2;
|
||||
|
||||
Reference in New Issue
Block a user