Add option -permitrbf to set transaction replacement policy
Add a configuration option `-permitrbf` to set transaction replacement policy for the mempool. Enabling it will enable (opt-in) RBF, disabling it will refuse all conflicting transactions.
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -78,6 +78,7 @@ bool fAlerts = DEFAULT_ALERTS;
|
||||
/* If the tip is older than this (in seconds), the node is considered to be in initial block download.
|
||||
*/
|
||||
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
|
||||
bool fPermitReplacement = DEFAULT_PERMIT_REPLACEMENT;
|
||||
|
||||
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying, mining and transaction creation) */
|
||||
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
|
||||
@@ -868,12 +869,15 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
|
||||
// unconfirmed ancestors anyway; doing otherwise is hopelessly
|
||||
// insecure.
|
||||
bool fReplacementOptOut = true;
|
||||
BOOST_FOREACH(const CTxIn &txin, ptxConflicting->vin)
|
||||
if (fPermitReplacement)
|
||||
{
|
||||
if (txin.nSequence < std::numeric_limits<unsigned int>::max()-1)
|
||||
BOOST_FOREACH(const CTxIn &txin, ptxConflicting->vin)
|
||||
{
|
||||
fReplacementOptOut = false;
|
||||
break;
|
||||
if (txin.nSequence < std::numeric_limits<unsigned int>::max()-1)
|
||||
{
|
||||
fReplacementOptOut = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fReplacementOptOut)
|
||||
|
||||
Reference in New Issue
Block a user