Changeset View
Changeset View
Standalone View
Standalone View
src/test/mempool_tests.cpp
Show First 20 Lines • Show All 572 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest) { | ||||
if (tx3.GetId() < tx6.GetId()) { | if (tx3.GetId() < tx6.GetId()) { | ||||
sortedOrder.pop_back(); | sortedOrder.pop_back(); | ||||
} else { | } else { | ||||
sortedOrder.erase(sortedOrder.end() - 2); | sortedOrder.erase(sortedOrder.end() - 2); | ||||
} | } | ||||
sortedOrder.insert(sortedOrder.begin(), tx7.GetId().ToString()); | sortedOrder.insert(sortedOrder.begin(), tx7.GetId().ToString()); | ||||
CheckSort<ancestor_score>(pool, sortedOrder, | CheckSort<ancestor_score>(pool, sortedOrder, | ||||
"MempoolAncestorIndexingTest4"); | "MempoolAncestorIndexingTest4"); | ||||
// High-fee parent, low-fee child | |||||
// tx7 -> tx8 | |||||
CMutableTransaction tx8 = CMutableTransaction(); | |||||
tx8.vin.resize(1); | |||||
tx8.vin[0].prevout = COutPoint(tx7.GetId(), 0); | |||||
tx8.vin[0].scriptSig = CScript() << OP_11; | |||||
tx8.vout.resize(1); | |||||
tx8.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | |||||
tx8.vout[0].nValue = 10 * COIN; | |||||
// Check that we sort by min(feerate, ancestor_feerate): | |||||
// set the fee so that the ancestor feerate is above tx1/5, | |||||
// but the transaction's own feerate is lower | |||||
pool.addUnchecked(tx8.GetId(), | |||||
entry.Fee(Amount(5000 * SATOSHI)).FromTx(tx8)); | |||||
sortedOrder.insert(sortedOrder.end() - 1, tx8.GetId().ToString()); | |||||
CheckSort<ancestor_score>(pool, sortedOrder, | |||||
"MempoolAncestorIndexingTest5"); | |||||
} | } | ||||
BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest) { | BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest) { | ||||
CTxMemPool pool; | CTxMemPool pool; | ||||
TestMemPoolEntryHelper entry; | TestMemPoolEntryHelper entry; | ||||
entry.dPriority = 10.0; | entry.dPriority = 10.0; | ||||
Amount feeIncrement = MEMPOOL_FULL_FEE_INCREMENT.GetFeePerK(); | Amount feeIncrement = MEMPOOL_FULL_FEE_INCREMENT.GetFeePerK(); | ||||
▲ Show 20 Lines • Show All 447 Lines • Show Last 20 Lines |