aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-21 11:11:01 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-21 11:24:31 +0100
commitb768108d9c0b83330572711aef1e569543130d5e (patch)
tree58dfaa61ddf765388da9e98c4ed5b16092796b32 /src/main.cpp
parentae2db67feec25fb89412429bd50250cb995bec87 (diff)
downloadbitcoin-b768108d9c0b83330572711aef1e569543130d5e.tar.xz
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9870beecc7..8522b0d1ba 100644
--- a/src/main.cpp
+++ b/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)