Skip to content

Commit 249f43f

Browse files
committed
[refactor] add option to disable RBF
This is a mere refactor for now. We will use this to disable RBFing in package validation.
1 parent 897e348 commit 249f43f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/validation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ class MemPoolAccept
470470
*/
471471
std::vector<COutPoint>& m_coins_to_uncache;
472472
const bool m_test_accept;
473+
/** Disable BIP125 RBFing; disallow all conflicts with mempool transactions. */
474+
const bool disallow_mempool_conflicts;
473475
};
474476

475477
// Single transaction acceptance
@@ -631,7 +633,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
631633
break;
632634
}
633635
}
634-
if (fReplacementOptOut) {
636+
if (fReplacementOptOut || args.disallow_mempool_conflicts) {
635637
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-mempool-conflict");
636638
}
637639

@@ -1072,7 +1074,8 @@ static MempoolAcceptResult AcceptToMemoryPoolWithTime(const CChainParams& chainp
10721074
EXCLUSIVE_LOCKS_REQUIRED(cs_main)
10731075
{
10741076
std::vector<COutPoint> coins_to_uncache;
1075-
MemPoolAccept::ATMPArgs args { chainparams, nAcceptTime, bypass_limits, coins_to_uncache, test_accept };
1077+
MemPoolAccept::ATMPArgs args { chainparams, nAcceptTime, bypass_limits, coins_to_uncache,
1078+
test_accept, /* disallow_mempool_conflicts */ false };
10761079

10771080
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
10781081
const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);

0 commit comments

Comments
 (0)