1414
1515BOOST_FIXTURE_TEST_SUITE (mempool_tests, TestingSetup)
1616
17+ static constexpr auto REMOVAL_REASON_DUMMY = MemPoolRemovalReason::REPLACED;
18+
1719BOOST_AUTO_TEST_CASE (MempoolRemoveTest)
1820{
1921 // Test CTxMemPool::remove functionality
@@ -59,13 +61,13 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
5961
6062 // Nothing in pool, remove should do nothing:
6163 unsigned int poolSize = testPool.size ();
62- testPool.removeRecursive (CTransaction (txParent));
64+ testPool.removeRecursive (CTransaction (txParent), REMOVAL_REASON_DUMMY );
6365 BOOST_CHECK_EQUAL (testPool.size (), poolSize);
6466
6567 // Just the parent:
6668 testPool.addUnchecked (entry.FromTx (txParent));
6769 poolSize = testPool.size ();
68- testPool.removeRecursive (CTransaction (txParent));
70+ testPool.removeRecursive (CTransaction (txParent), REMOVAL_REASON_DUMMY );
6971 BOOST_CHECK_EQUAL (testPool.size (), poolSize - 1 );
7072
7173 // Parent, children, grandchildren:
@@ -77,18 +79,18 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
7779 }
7880 // Remove Child[0], GrandChild[0] should be removed:
7981 poolSize = testPool.size ();
80- testPool.removeRecursive (CTransaction (txChild[0 ]));
82+ testPool.removeRecursive (CTransaction (txChild[0 ]), REMOVAL_REASON_DUMMY );
8183 BOOST_CHECK_EQUAL (testPool.size (), poolSize - 2 );
8284 // ... make sure grandchild and child are gone:
8385 poolSize = testPool.size ();
84- testPool.removeRecursive (CTransaction (txGrandChild[0 ]));
86+ testPool.removeRecursive (CTransaction (txGrandChild[0 ]), REMOVAL_REASON_DUMMY );
8587 BOOST_CHECK_EQUAL (testPool.size (), poolSize);
8688 poolSize = testPool.size ();
87- testPool.removeRecursive (CTransaction (txChild[0 ]));
89+ testPool.removeRecursive (CTransaction (txChild[0 ]), REMOVAL_REASON_DUMMY );
8890 BOOST_CHECK_EQUAL (testPool.size (), poolSize);
8991 // Remove parent, all children/grandchildren should go:
9092 poolSize = testPool.size ();
91- testPool.removeRecursive (CTransaction (txParent));
93+ testPool.removeRecursive (CTransaction (txParent), REMOVAL_REASON_DUMMY );
9294 BOOST_CHECK_EQUAL (testPool.size (), poolSize - 5 );
9395 BOOST_CHECK_EQUAL (testPool.size (), 0U );
9496
@@ -101,7 +103,7 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
101103 // Now remove the parent, as might happen if a block-re-org occurs but the parent cannot be
102104 // put into the mempool (maybe because it is non-standard):
103105 poolSize = testPool.size ();
104- testPool.removeRecursive (CTransaction (txParent));
106+ testPool.removeRecursive (CTransaction (txParent), REMOVAL_REASON_DUMMY );
105107 BOOST_CHECK_EQUAL (testPool.size (), poolSize - 6 );
106108 BOOST_CHECK_EQUAL (testPool.size (), 0U );
107109}
@@ -283,11 +285,11 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
283285 BOOST_CHECK_EQUAL (pool.size (), 10U );
284286
285287 // Now try removing tx10 and verify the sort order returns to normal
286- pool.removeRecursive (pool.mapTx .find (tx10.GetHash ())->GetTx ());
288+ pool.removeRecursive (pool.mapTx .find (tx10.GetHash ())->GetTx (), REMOVAL_REASON_DUMMY );
287289 CheckSort<descendant_score>(pool, snapshotOrder);
288290
289- pool.removeRecursive (pool.mapTx .find (tx9.GetHash ())->GetTx ());
290- pool.removeRecursive (pool.mapTx .find (tx8.GetHash ())->GetTx ());
291+ pool.removeRecursive (pool.mapTx .find (tx9.GetHash ())->GetTx (), REMOVAL_REASON_DUMMY );
292+ pool.removeRecursive (pool.mapTx .find (tx8.GetHash ())->GetTx (), REMOVAL_REASON_DUMMY );
291293}
292294
293295BOOST_AUTO_TEST_CASE (MempoolAncestorIndexingTest)
0 commit comments