Skip to content

Commit fa2102e

Browse files
author
MacroFake
committed
test: Split MempoolAncestryTests into two
1 parent 91a6736 commit fa2102e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/mempool_tests.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,15 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
747747
pool.GetTransactionAncestry(ty6->GetHash(), ancestors, descendants);
748748
BOOST_CHECK_EQUAL(ancestors, 9ULL);
749749
BOOST_CHECK_EQUAL(descendants, 6ULL);
750+
}
751+
752+
BOOST_AUTO_TEST_CASE(MempoolAncestryTestsDiamond)
753+
{
754+
size_t ancestors, descendants;
755+
756+
CTxMemPool pool;
757+
LOCK2(::cs_main, pool.cs);
758+
TestMemPoolEntryHelper entry;
750759

751760
/* Ancestors represented more than once ("diamond") */
752761
//
@@ -759,7 +768,6 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
759768
tb = make_tx(/*output_values=*/{5 * COIN, 3 * COIN}, /*inputs=*/ {ta});
760769
tc = make_tx(/*output_values=*/{2 * COIN}, /*inputs=*/{tb}, /*input_indices=*/{1});
761770
td = make_tx(/*output_values=*/{6 * COIN}, /*inputs=*/{tb, tc}, /*input_indices=*/{0, 0});
762-
pool.clear();
763771
pool.addUnchecked(entry.Fee(10000LL).FromTx(ta));
764772
pool.addUnchecked(entry.Fee(10000LL).FromTx(tb));
765773
pool.addUnchecked(entry.Fee(10000LL).FromTx(tc));

0 commit comments

Comments
 (0)