From e8d19ab79f9367d3adb43fb041b26f78f0f38eb3 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 28 Jan 2016 05:27:25 +0000 Subject: [PATCH] Accept replacebyfee=opt-in for turning on opt-in RBF Basic forward-compatibility with more flexible parameters like fss --- src/init.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index a7428531a7912..291487a9509db 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -47,8 +47,10 @@ #include #endif +#include #include #include +#include #include #include #include @@ -1017,6 +1019,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) nLocalServices |= NODE_BLOOM; 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