@@ -605,31 +605,14 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
605
605
}
606
606
if (!setConflicts.count (ptxConflicting->GetHash ()))
607
607
{
608
- // Allow opt-out of transaction replacement by setting
609
- // nSequence > MAX_BIP125_RBF_SEQUENCE (SEQUENCE_FINAL-2) on all inputs.
610
- //
611
- // SEQUENCE_FINAL-1 is picked to still allow use of nLockTime by
612
- // non-replaceable transactions. All inputs rather than just one
613
- // is for the sake of multi-party protocols, where we don't
614
- // want a single party to be able to disable replacement.
615
- //
616
608
// Transactions that don't explicitly signal replaceability are
617
609
// *not* replaceable with the current logic, even if one of their
618
610
// unconfirmed ancestors signals replaceability. This diverges
619
611
// from BIP125's inherited signaling description (see CVE-2021-31876).
620
612
// Applications relying on first-seen mempool behavior should
621
613
// check all unconfirmed ancestors; otherwise an opt-in ancestor
622
614
// might be replaced, causing removal of this descendant.
623
- bool fReplacementOptOut = true ;
624
- for (const CTxIn &_txin : ptxConflicting->vin )
625
- {
626
- if (_txin.nSequence <= MAX_BIP125_RBF_SEQUENCE)
627
- {
628
- fReplacementOptOut = false ;
629
- break ;
630
- }
631
- }
632
- if (fReplacementOptOut ) {
615
+ if (!SignalsOptInRBF (*ptxConflicting)) {
633
616
return state.Invalid (TxValidationResult::TX_MEMPOOL_POLICY, " txn-mempool-conflict" );
634
617
}
635
618
0 commit comments