diff options
author | MacroFake <falke.marco@gmail.com> | 2022-04-29 09:47:09 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-04-29 09:43:11 +0200 |
commit | fa2102e239a01fab648e60de915f9072c5544828 (patch) | |
tree | 1e188add33609dc93098abc536aea4e20e5c5c76 /src/test/mempool_tests.cpp | |
parent | 91a67361364691e765982d6d6f6dafc032423aea (diff) | |
download | bitcoin-fa2102e239a01fab648e60de915f9072c5544828.tar.xz |
test: Split MempoolAncestryTests into two
Diffstat (limited to 'src/test/mempool_tests.cpp')
-rw-r--r-- | src/test/mempool_tests.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp index d6f24210eb..89424a0cd2 100644 --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -747,6 +747,15 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests) pool.GetTransactionAncestry(ty6->GetHash(), ancestors, descendants); BOOST_CHECK_EQUAL(ancestors, 9ULL); BOOST_CHECK_EQUAL(descendants, 6ULL); +} + +BOOST_AUTO_TEST_CASE(MempoolAncestryTestsDiamond) +{ + size_t ancestors, descendants; + + CTxMemPool pool; + LOCK2(::cs_main, pool.cs); + TestMemPoolEntryHelper entry; /* Ancestors represented more than once ("diamond") */ // @@ -759,7 +768,6 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests) tb = make_tx(/*output_values=*/{5 * COIN, 3 * COIN}, /*inputs=*/ {ta}); tc = make_tx(/*output_values=*/{2 * COIN}, /*inputs=*/{tb}, /*input_indices=*/{1}); td = make_tx(/*output_values=*/{6 * COIN}, /*inputs=*/{tb, tc}, /*input_indices=*/{0, 0}); - pool.clear(); pool.addUnchecked(entry.Fee(10000LL).FromTx(ta)); pool.addUnchecked(entry.Fee(10000LL).FromTx(tb)); pool.addUnchecked(entry.Fee(10000LL).FromTx(tc)); |