@@ -457,10 +457,12 @@ class MemPoolAccept
457
457
std::vector<COutPoint>& m_coins_to_uncache;
458
458
/* * When true, the transaction or package will not be submitted to the mempool. */
459
459
const bool m_test_accept;
460
- /* * Whether we allow transactions to replace mempool transactions by BIP125 rules . If false,
460
+ /* * Whether we allow transactions to replace mempool transactions. If false,
461
461
* any transaction spending the same inputs as a transaction in the mempool is considered
462
462
* a conflict. */
463
463
const bool m_allow_replacement;
464
+ /* * When true, allow sibling eviction. This only occurs in single transaction package settings. */
465
+ const bool m_allow_sibling_eviction;
464
466
/* * When true, the mempool will not be trimmed when any transactions are submitted in
465
467
* Finalize(). Instead, limits should be enforced at the end to ensure the package is not
466
468
* partially submitted.
@@ -486,6 +488,7 @@ class MemPoolAccept
486
488
/* m_coins_to_uncache */ coins_to_uncache,
487
489
/* m_test_accept */ test_accept,
488
490
/* m_allow_replacement */ true ,
491
+ /* m_allow_sibling_eviction */ true ,
489
492
/* m_package_submission */ false ,
490
493
/* m_package_feerates */ false ,
491
494
/* m_client_maxfeerate */ {}, // checked by caller
@@ -501,6 +504,7 @@ class MemPoolAccept
501
504
/* m_coins_to_uncache */ coins_to_uncache,
502
505
/* m_test_accept */ true ,
503
506
/* m_allow_replacement */ false ,
507
+ /* m_allow_sibling_eviction */ false ,
504
508
/* m_package_submission */ false , // not submitting to mempool
505
509
/* m_package_feerates */ false ,
506
510
/* m_client_maxfeerate */ {}, // checked by caller
@@ -516,6 +520,7 @@ class MemPoolAccept
516
520
/* m_coins_to_uncache */ coins_to_uncache,
517
521
/* m_test_accept */ false ,
518
522
/* m_allow_replacement */ false ,
523
+ /* m_allow_sibling_eviction */ false ,
519
524
/* m_package_submission */ true ,
520
525
/* m_package_feerates */ true ,
521
526
/* m_client_maxfeerate */ client_maxfeerate,
@@ -530,6 +535,7 @@ class MemPoolAccept
530
535
/* m_coins_to_uncache */ package_args.m_coins_to_uncache ,
531
536
/* m_test_accept */ package_args.m_test_accept ,
532
537
/* m_allow_replacement */ true ,
538
+ /* m_allow_sibling_eviction */ true ,
533
539
/* m_package_submission */ true , // do not LimitMempoolSize in Finalize()
534
540
/* m_package_feerates */ false , // only 1 transaction
535
541
/* m_client_maxfeerate */ package_args.m_client_maxfeerate ,
@@ -545,6 +551,7 @@ class MemPoolAccept
545
551
std::vector<COutPoint>& coins_to_uncache,
546
552
bool test_accept,
547
553
bool allow_replacement,
554
+ bool allow_sibling_eviction,
548
555
bool package_submission,
549
556
bool package_feerates,
550
557
std::optional<CFeeRate> client_maxfeerate)
@@ -554,6 +561,7 @@ class MemPoolAccept
554
561
m_coins_to_uncache{coins_to_uncache},
555
562
m_test_accept{test_accept},
556
563
m_allow_replacement{allow_replacement},
564
+ m_allow_sibling_eviction{allow_sibling_eviction},
557
565
m_package_submission{package_submission},
558
566
m_package_feerates{package_feerates},
559
567
m_client_maxfeerate{client_maxfeerate}
@@ -981,8 +989,11 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
981
989
// check using the full ancestor set here because it's more convenient to use what we have
982
990
// already calculated.
983
991
if (const auto err{SingleV3Checks (ws.m_ptx , ws.m_ancestors , ws.m_conflicts , ws.m_vsize )}) {
984
- // Disabled within package validation.
985
- if (err->second != nullptr && args.m_allow_replacement ) {
992
+ // Single transaction contexts only.
993
+ if (args.m_allow_sibling_eviction && err->second != nullptr ) {
994
+ // We should only be considering where replacement is considered valid as well.
995
+ Assume (args.m_allow_replacement );
996
+
986
997
// Potential sibling eviction. Add the sibling to our list of mempool conflicts to be
987
998
// included in RBF checks.
988
999
ws.m_conflicts .insert (err->second ->GetHash ());
0 commit comments