|
47 | 47 | #include <signal.h> |
48 | 48 | #endif |
49 | 49 |
|
| 50 | +#include <boost/algorithm/string/classification.hpp> |
50 | 51 | #include <boost/algorithm/string/predicate.hpp> |
51 | 52 | #include <boost/algorithm/string/replace.hpp> |
| 53 | +#include <boost/algorithm/string/split.hpp> |
52 | 54 | #include <boost/bind.hpp> |
53 | 55 | #include <boost/filesystem.hpp> |
54 | 56 | #include <boost/function.hpp> |
@@ -367,7 +369,6 @@ std::string HelpMessage(HelpMessageMode mode) |
367 | 369 | strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy")); |
368 | 370 | strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)")); |
369 | 371 | strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), DEFAULT_PERMIT_BAREMULTISIG)); |
370 | | - strUsage += HelpMessageOpt("-permitrbf", strprintf(_("Permit transaction replacement (default: %u)"), DEFAULT_PERMIT_REPLACEMENT)); |
371 | 372 | strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with bloom filters (default: %u)"), 1)); |
372 | 373 | if (showDebug) |
373 | 374 | strUsage += HelpMessageOpt("-enforcenodebloom", strprintf("Enforce minimum protocol version to limit use of bloom filters (default: %u)", 0)); |
@@ -488,6 +489,7 @@ std::string HelpMessage(HelpMessageMode mode) |
488 | 489 | strUsage += HelpMessageOpt("-bytespersigop", strprintf(_("Minimum bytes per sigop in transactions we relay and mine (default: %u)"), DEFAULT_BYTES_PER_SIGOP)); |
489 | 490 | strUsage += HelpMessageOpt("-datacarrier", strprintf(_("Relay and mine data carrier transactions (default: %u)"), DEFAULT_ACCEPT_DATACARRIER)); |
490 | 491 | strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY)); |
| 492 | + strUsage += HelpMessageOpt("-mempoolreplacement", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT)); |
491 | 493 |
|
492 | 494 | strUsage += HelpMessageGroup(_("Block creation options:")); |
493 | 495 | strUsage += HelpMessageOpt("-blockminsize=<n>", strprintf(_("Set minimum block size in bytes (default: %u)"), DEFAULT_BLOCK_MIN_SIZE)); |
@@ -1026,7 +1028,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
1026 | 1028 | if (GetBoolArg("-peerbloomfilters", true)) |
1027 | 1029 | nLocalServices |= NODE_BLOOM; |
1028 | 1030 |
|
1029 | | - fPermitReplacement = GetBoolArg("-permitrbf", DEFAULT_PERMIT_REPLACEMENT); |
| 1031 | + fEnableReplacement = GetBoolArg("-mempoolreplacement", DEFAULT_ENABLE_REPLACEMENT); |
| 1032 | + if ((!fEnableReplacement) && mapArgs.count("-mempoolreplacement")) { |
| 1033 | + // Minimal effort at forwards compatibility |
| 1034 | + std::string strReplacementModeList = GetArg("-mempoolreplacement", ""); // default is impossible |
| 1035 | + std::vector<std::string> vstrReplacementModes; |
| 1036 | + boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(",")); |
| 1037 | + fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end()); |
| 1038 | + } |
1030 | 1039 |
|
1031 | 1040 | // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log |
1032 | 1041 |
|
|
0 commit comments