Merge #9499: Use recent-rejects, orphans, and recently-replaced txn for compact-block-reconstruction
c594580Add braces around AddToCompactExtraTransactions (Matt Corallo)1ccfe9bClarify comment about mempool/extra conflicts (Matt Corallo)fac4c78Make PartiallyDownloadedBlock::InitData's second param const (Matt Corallo)b55b416Add extra_count lower bound to compact reconstruction debug print (Matt Corallo)863edb4Consider all (<100k memusage) txn for compact-block-extra-txn cache (Matt Corallo)7f8c8caConsider all orphan txn for compact-block-extra-txn cache (Matt Corallo)93380c5Use replaced transactions in compact block reconstruction (Matt Corallo)1531652Keep shared_ptrs to recently-replaced txn for compact blocks (Matt Corallo)edded80Make ATMP optionally return the CTransactionRefs it replaced (Matt Corallo)c735540Move ORPHAN constants from validation.h to net_processing.h (Matt Corallo)
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;
|
||||
|
||||
@@ -23,7 +23,7 @@ ToMemPool(CMutableTransaction& tx)
|
||||
LOCK(cs_main);
|
||||
|
||||
CValidationState state;
|
||||
return AcceptToMemoryPool(mempool, state, MakeTransactionRef(tx), false, NULL, true, 0);
|
||||
return AcceptToMemoryPool(mempool, state, MakeTransactionRef(tx), false, NULL, NULL, true, 0);
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
|
||||
|
||||
Reference in New Issue
Block a user