aboutsummaryrefslogtreecommitdiff
path: root/src/test/rbf_tests.cpp
diff options
context:
space:
mode:
authorGreg Sanders <gsanders87@gmail.com>2024-03-25 10:32:54 -0400
committerGreg Sanders <gsanders87@gmail.com>2024-03-26 08:20:30 -0400
commit216d5ff1627be6562312b5afb477078ed8495999 (patch)
tree819ad73be2bb6103150d1b63dc8d39e38f09358e /src/test/rbf_tests.cpp
parenta80d80936a8de487569d00755d0fbcd058a94823 (diff)
unit test: add coverage showing priority affects diagram check results
Diffstat (limited to 'src/test/rbf_tests.cpp')
-rw-r--r--src/test/rbf_tests.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/rbf_tests.cpp b/src/test/rbf_tests.cpp
index 8fe2db1a7f..ddfb6a9a87 100644
--- a/src/test/rbf_tests.cpp
+++ b/src/test/rbf_tests.cpp
@@ -385,6 +385,14 @@ BOOST_FIXTURE_TEST_CASE(improves_feerate, TestChain100Setup)
// With one more satoshi it does
BOOST_CHECK(ImprovesFeerateDiagram(pool, {entry1}, {entry1, entry2}, tx1_fee + tx2_fee + 1, tx1_size + tx2_size) == std::nullopt);
+ // With prioritisation of in-mempool conflicts, it affects the results of the comparison using the same args as just above
+ pool.PrioritiseTransaction(entry1->GetSharedTx()->GetHash(), /*nFeeDelta=*/1);
+ const auto res2 = ImprovesFeerateDiagram(pool, {entry1}, {entry1, entry2}, tx1_fee + tx2_fee + 1, tx1_size + tx2_size);
+ BOOST_CHECK(res2.has_value());
+ BOOST_CHECK(res2.value().first == DiagramCheckError::FAILURE);
+ BOOST_CHECK(res2.value().second == "insufficient feerate: does not improve feerate diagram");
+ pool.PrioritiseTransaction(entry1->GetSharedTx()->GetHash(), /*nFeeDelta=*/-1);
+
// Adding a grandchild makes the cluster size 3, which is uncalculable
const auto tx3 = make_tx(/*inputs=*/ {tx2}, /*output_values=*/ {995 * CENT});
pool.addUnchecked(entry.Fee(normal_fee).FromTx(tx3));