From 77b55a00ed4a3a3a22ec3e299539a1812a0bc605 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 28 Jan 2016 05:09:29 +0000 Subject: Rename permitrbf to replacebyfee "permit" is currently used to configure transaction filtering, whereas replacement is more to do with the memory pool state than the transaction itself. --- src/init.cpp | 4 ++-- src/main.cpp | 4 ++-- src/main.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/init.cpp b/src/init.cpp index a6d26a02f1..0032a6d2d8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -367,7 +367,6 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-onion=", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy")); strUsage += HelpMessageOpt("-onlynet=", _("Only connect to nodes in network (ipv4, ipv6 or onion)")); strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), DEFAULT_PERMIT_BAREMULTISIG)); - strUsage += HelpMessageOpt("-permitrbf", strprintf(_("Permit transaction replacements in the memory pool (default: %u)"), DEFAULT_PERMIT_REPLACEMENT)); strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with bloom filters (default: %u)"), 1)); if (showDebug) strUsage += HelpMessageOpt("-enforcenodebloom", strprintf("Enforce minimum protocol version to limit use of bloom filters (default: %u)", 0)); @@ -488,6 +487,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-bytespersigop", strprintf(_("Minimum bytes per sigop in transactions we relay and mine (default: %u)"), DEFAULT_BYTES_PER_SIGOP)); strUsage += HelpMessageOpt("-datacarrier", strprintf(_("Relay and mine data carrier transactions (default: %u)"), DEFAULT_ACCEPT_DATACARRIER)); strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY)); + strUsage += HelpMessageOpt("-replacebyfee", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT)); strUsage += HelpMessageGroup(_("Block creation options:")); strUsage += HelpMessageOpt("-blockminsize=", strprintf(_("Set minimum block size in bytes (default: %u)"), DEFAULT_BLOCK_MIN_SIZE)); @@ -1030,7 +1030,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) nLocalServices |= NODE_BLOOM; nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); - fPermitReplacement = GetBoolArg("-permitrbf", DEFAULT_PERMIT_REPLACEMENT); + fEnableReplacement = GetBoolArg("-replacebyfee", DEFAULT_ENABLE_REPLACEMENT); // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log diff --git a/src/main.cpp b/src/main.cpp index c8ea62758b..392300d578 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,7 +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; +bool fEnableReplacement = DEFAULT_ENABLE_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); @@ -869,7 +869,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C // unconfirmed ancestors anyway; doing otherwise is hopelessly // insecure. bool fReplacementOptOut = true; - if (fPermitReplacement) + if (fEnableReplacement) { BOOST_FOREACH(const CTxIn &txin, ptxConflicting->vin) { diff --git a/src/main.h b/src/main.h index 98069a225d..ec426003a1 100644 --- a/src/main.h +++ b/src/main.h @@ -107,8 +107,8 @@ static const bool DEFAULT_TXINDEX = false; static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100; static const bool DEFAULT_TESTSAFEMODE = false; -/** Default for -permitrbf */ -static const bool DEFAULT_PERMIT_REPLACEMENT = true; +/** Default for -replacebyfee */ +static const bool DEFAULT_ENABLE_REPLACEMENT = true; /** Maximum number of headers to announce when relaying blocks with headers message.*/ static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8; @@ -141,7 +141,7 @@ extern size_t nCoinCacheUsage; extern CFeeRate minRelayTxFee; extern bool fAlerts; extern int64_t nMaxTipAge; -extern bool fPermitReplacement; +extern bool fEnableReplacement; /** Best header we've seen so far (used for getheaders queries' starting points). */ extern CBlockIndex *pindexBestHeader; -- cgit v1.2.3 From d65dee961e39937e3e671c742ff8db32612ad9af Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 28 Jan 2016 05:27:25 +0000 Subject: Accept replacebyfee=opt-in for turning on opt-in RBF Basic forward-compatibility with more flexible parameters like fss --- src/init.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/init.cpp b/src/init.cpp index 0032a6d2d8..547e94ad61 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -47,8 +47,10 @@ #include #endif +#include #include #include +#include #include #include #include @@ -1030,7 +1032,20 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) nLocalServices |= NODE_BLOOM; nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); + fEnableReplacement = GetBoolArg("-replacebyfee", DEFAULT_ENABLE_REPLACEMENT); + if ((!fEnableReplacement) && mapArgs.count("-replacebyfee")) { + // Minimal effort at forwards compatibility + std::string strReplacementModeList = GetArg("-replacebyfee", ""); // default is impossible + std::vector vstrReplacementModes; + boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(",")); + BOOST_FOREACH(const std::string& strReplacementMode, vstrReplacementModes) { + if (strReplacementMode == "opt-in") { + fEnableReplacement = true; + break; + } + } + } // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log -- cgit v1.2.3 From 3b66e54457cdfe1f5ffda016d42c23fe848d539c Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 29 Jan 2016 01:28:54 +0000 Subject: Simplify check for replacebyfee=opt-in --- src/init.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/init.cpp b/src/init.cpp index 547e94ad61..80b014eb98 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1039,12 +1039,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) std::string strReplacementModeList = GetArg("-replacebyfee", ""); // default is impossible std::vector vstrReplacementModes; boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(",")); - BOOST_FOREACH(const std::string& strReplacementMode, vstrReplacementModes) { - if (strReplacementMode == "opt-in") { - fEnableReplacement = true; - break; - } - } + fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "opt-in") != vstrReplacementModes.end()); } // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log -- cgit v1.2.3 From b922fbe063b46862aae6efb35074d1e010fe7006 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 1 Feb 2016 19:30:37 +0000 Subject: Rename replacebyfee=opt-in to mempoolreplacement=fee --- src/init.cpp | 10 +++++----- src/main.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/init.cpp b/src/init.cpp index 80b014eb98..b5b1cb822a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -489,7 +489,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-bytespersigop", strprintf(_("Minimum bytes per sigop in transactions we relay and mine (default: %u)"), DEFAULT_BYTES_PER_SIGOP)); strUsage += HelpMessageOpt("-datacarrier", strprintf(_("Relay and mine data carrier transactions (default: %u)"), DEFAULT_ACCEPT_DATACARRIER)); strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY)); - strUsage += HelpMessageOpt("-replacebyfee", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT)); + strUsage += HelpMessageOpt("-mempoolreplacement", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT)); strUsage += HelpMessageGroup(_("Block creation options:")); strUsage += HelpMessageOpt("-blockminsize=", strprintf(_("Set minimum block size in bytes (default: %u)"), DEFAULT_BLOCK_MIN_SIZE)); @@ -1033,13 +1033,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); - fEnableReplacement = GetBoolArg("-replacebyfee", DEFAULT_ENABLE_REPLACEMENT); - if ((!fEnableReplacement) && mapArgs.count("-replacebyfee")) { + fEnableReplacement = GetBoolArg("-mempoolreplacement", DEFAULT_ENABLE_REPLACEMENT); + if ((!fEnableReplacement) && mapArgs.count("-mempoolreplacement")) { // Minimal effort at forwards compatibility - std::string strReplacementModeList = GetArg("-replacebyfee", ""); // default is impossible + std::string strReplacementModeList = GetArg("-mempoolreplacement", ""); // default is impossible std::vector vstrReplacementModes; boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(",")); - fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "opt-in") != vstrReplacementModes.end()); + fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end()); } // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log diff --git a/src/main.h b/src/main.h index ec426003a1..0bbec1e8ce 100644 --- a/src/main.h +++ b/src/main.h @@ -107,7 +107,7 @@ static const bool DEFAULT_TXINDEX = false; static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100; static const bool DEFAULT_TESTSAFEMODE = false; -/** Default for -replacebyfee */ +/** Default for -mempoolreplacement */ static const bool DEFAULT_ENABLE_REPLACEMENT = true; /** Maximum number of headers to announce when relaying blocks with headers message.*/ -- cgit v1.2.3