Skip to content

Commit 446b08b

Browse files
committed
Don't distinguish between direct conflicts and all conflicts when doing cluster-size-2-rbf checks
1 parent b530410 commit 446b08b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/policy/rbf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ std::optional<std::pair<DiagramCheckError, std::string>> ImprovesFeerateDiagram(
191191
int64_t replacement_vsize)
192192
{
193193
// Require that the replacement strictly improves the mempool's feerate diagram.
194-
const auto chunk_results{pool.CalculateChunksForRBF(replacement_fees, replacement_vsize, direct_conflicts, all_conflicts)};
194+
const auto chunk_results{pool.CalculateChunksForRBF(replacement_fees, replacement_vsize, all_conflicts, all_conflicts)};
195195

196196
if (!chunk_results.has_value()) {
197197
return std::make_pair(DiagramCheckError::UNCALCULABLE, util::ErrorString(chunk_results).original);

src/test/rbf_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ BOOST_FIXTURE_TEST_CASE(improves_feerate, TestChain100Setup)
402402
const auto res3 = ImprovesFeerateDiagram(pool, {entry1}, {entry1, entry2}, tx1_fee + tx2_fee + 1, tx1_size + tx2_size);
403403
BOOST_CHECK(res3.has_value());
404404
BOOST_CHECK(res3.value().first == DiagramCheckError::UNCALCULABLE);
405-
BOOST_CHECK(res3.value().second == strprintf("%s has 2 descendants, max 1 allowed", tx1->GetHash().GetHex()));
405+
BOOST_CHECK(res3.value().second == strprintf("%s has both ancestor and descendant, exceeding cluster limit of 2", tx2->GetHash().GetHex()));
406406

407407
}
408408

test/functional/mempool_package_rbf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ def test_wrong_conflict_cluster_size_parents_child(self):
391391
# Now make conflicting packages for each coin
392392
package_hex1, _package_txns1 = self.create_simple_package(coin1, DEFAULT_FEE, DEFAULT_CHILD_FEE)
393393
package_result = node.submitpackage(package_hex1)
394-
assert_equal(f"package RBF failed: {parent1_result['tx'].rehash()} is not the only parent of child {child_result['tx'].rehash()}", package_result["package_msg"])
394+
assert_equal(f"package RBF failed: {child_result['tx'].rehash()} has 2 ancestors, max 1 allowed", package_result["package_msg"])
395395

396396
package_hex2, _package_txns2 = self.create_simple_package(coin2, DEFAULT_FEE, DEFAULT_CHILD_FEE)
397397
package_result = node.submitpackage(package_hex2)
398-
assert_equal(f"package RBF failed: {parent2_result['tx'].rehash()} is not the only parent of child {child_result['tx'].rehash()}", package_result["package_msg"])
398+
assert_equal(f"package RBF failed: {child_result['tx'].rehash()} has 2 ancestors, max 1 allowed", package_result["package_msg"])
399399

400400
package_hex3, _package_txns3 = self.create_simple_package(coin3, DEFAULT_FEE, DEFAULT_CHILD_FEE)
401401
package_result = node.submitpackage(package_hex3)
@@ -445,7 +445,7 @@ def test_wrong_conflict_cluster_size_parent_children(self):
445445
# Now make conflicting packages for each coin
446446
package_hex1, _package_txns1 = self.create_simple_package(coin1, DEFAULT_FEE, DEFAULT_CHILD_FEE)
447447
package_result = node.submitpackage(package_hex1)
448-
assert_equal(f"package RBF failed: {parent_result['tx'].rehash()} has 2 descendants, max 1 allowed", package_result["package_msg"])
448+
assert_equal(f"package RBF failed: {child2_result['tx'].rehash()} is not the only child of parent {parent_result['tx'].rehash()}", package_result["package_msg"])
449449

450450
package_hex2, _package_txns2 = self.create_simple_package(coin2, DEFAULT_FEE, DEFAULT_CHILD_FEE)
451451
package_result = node.submitpackage(package_hex2)

0 commit comments

Comments
 (0)