Skip to content

Commit 216d5ff

Browse files
committed
unit test: add coverage showing priority affects diagram check results
1 parent a80d809 commit 216d5ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/rbf_tests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ BOOST_FIXTURE_TEST_CASE(improves_feerate, TestChain100Setup)
385385
// With one more satoshi it does
386386
BOOST_CHECK(ImprovesFeerateDiagram(pool, {entry1}, {entry1, entry2}, tx1_fee + tx2_fee + 1, tx1_size + tx2_size) == std::nullopt);
387387

388+
// With prioritisation of in-mempool conflicts, it affects the results of the comparison using the same args as just above
389+
pool.PrioritiseTransaction(entry1->GetSharedTx()->GetHash(), /*nFeeDelta=*/1);
390+
const auto res2 = ImprovesFeerateDiagram(pool, {entry1}, {entry1, entry2}, tx1_fee + tx2_fee + 1, tx1_size + tx2_size);
391+
BOOST_CHECK(res2.has_value());
392+
BOOST_CHECK(res2.value().first == DiagramCheckError::FAILURE);
393+
BOOST_CHECK(res2.value().second == "insufficient feerate: does not improve feerate diagram");
394+
pool.PrioritiseTransaction(entry1->GetSharedTx()->GetHash(), /*nFeeDelta=*/-1);
395+
388396
// Adding a grandchild makes the cluster size 3, which is uncalculable
389397
const auto tx3 = make_tx(/*inputs=*/ {tx2}, /*output_values=*/ {995 * CENT});
390398
pool.addUnchecked(entry.Fee(normal_fee).FromTx(tx3));

0 commit comments

Comments
 (0)