mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-09 05:14:22 +01:00
[refactor] add option to disable RBF
This is a mere refactor for now. We will use this to disable RBFing in package validation.
This commit is contained in:
parent
897e348f59
commit
249f43f3cc
1 changed files with 5 additions and 2 deletions
|
@ -470,6 +470,8 @@ public:
|
||||||
*/
|
*/
|
||||||
std::vector<COutPoint>& m_coins_to_uncache;
|
std::vector<COutPoint>& m_coins_to_uncache;
|
||||||
const bool m_test_accept;
|
const bool m_test_accept;
|
||||||
|
/** Disable BIP125 RBFing; disallow all conflicts with mempool transactions. */
|
||||||
|
const bool disallow_mempool_conflicts;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Single transaction acceptance
|
// Single transaction acceptance
|
||||||
|
@ -631,7 +633,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fReplacementOptOut) {
|
if (fReplacementOptOut || args.disallow_mempool_conflicts) {
|
||||||
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-mempool-conflict");
|
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-mempool-conflict");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,7 +1074,8 @@ static MempoolAcceptResult AcceptToMemoryPoolWithTime(const CChainParams& chainp
|
||||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||||
{
|
{
|
||||||
std::vector<COutPoint> coins_to_uncache;
|
std::vector<COutPoint> coins_to_uncache;
|
||||||
MemPoolAccept::ATMPArgs args { chainparams, nAcceptTime, bypass_limits, coins_to_uncache, test_accept };
|
MemPoolAccept::ATMPArgs args { chainparams, nAcceptTime, bypass_limits, coins_to_uncache,
|
||||||
|
test_accept, /* disallow_mempool_conflicts */ false };
|
||||||
|
|
||||||
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
|
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
|
||||||
const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
|
const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
|
||||||
|
|
Loading…
Add table
Reference in a new issue