Make it possible to unconditionally RBF with mempoolreplacement=fee,-optin

This commit is contained in:
Luke Dashjr 2016-02-13 01:46:40 +00:00 committed by Gregory Sanders
parent d0cccad9d4
commit 0853a234a4
3 changed files with 16 additions and 1 deletions

View file

@ -1153,8 +1153,16 @@ bool AppInitParameterInteraction()
// Minimal effort at forwards compatibility
std::string strReplacementModeList = gArgs.GetArg("-mempoolreplacement", ""); // default is impossible
std::vector<std::string> vstrReplacementModes;
boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(","));
boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(",+"));
fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end());
if (fEnableReplacement) {
fReplacementHonourOptOut = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "-optin") == vstrReplacementModes.end());
if (!fReplacementHonourOptOut) {
nLocalServices = ServiceFlags(nLocalServices | NODE_REPLACE_BY_FEE);
}
} else {
fReplacementHonourOptOut = true;
}
}
return true;