mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 13:02:38 +02:00
Make it possible to unconditionally RBF with mempoolreplacement=fee,-optin
This commit is contained in:
parent
8247f0741d
commit
45baf0ef8e
19
src/init.cpp
19
src/init.cpp
@ -649,7 +649,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
||||
MAX_OP_RETURN_RELAY),
|
||||
ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||
argsman.AddArg("-mempoolfullrbf", strprintf("Accept transaction replace-by-fee without requiring replaceability signaling (default: %u)", DEFAULT_MEMPOOL_FULL_RBF), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||
argsman.AddArg("-mempoolreplacement", strprintf("Enable transaction replacement in the memory pool (default: %u)", DEFAULT_ENABLE_REPLACEMENT), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||
argsman.AddArg("-mempoolreplacement", strprintf("Enable transaction replacement in the memory pool (\"fee,-optin\" = ignore opt-out flag, default: %u)", DEFAULT_ENABLE_REPLACEMENT), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||
argsman.AddArg("-permitbaremultisig", strprintf("Relay transactions creating non-P2SH multisig outputs (default: %u)", DEFAULT_PERMIT_BAREMULTISIG), ArgsManager::ALLOW_ANY,
|
||||
OptionsCategory::NODE_RELAY);
|
||||
argsman.AddArg("-minrelaytxfee=<amt>", strprintf("Fees (in %s/kvB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)",
|
||||
@ -894,6 +894,8 @@ bool AppInitBasicSetup(const ArgsManager& args, std::atomic<int>& exit_status)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gReplacementHonourOptOut; // FIXME: Get rid of this
|
||||
|
||||
bool AppInitParameterInteraction(const ArgsManager& args)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
@ -1060,11 +1062,23 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
||||
}
|
||||
|
||||
gEnableReplacement = args.GetBoolArg("-mempoolreplacement", DEFAULT_ENABLE_REPLACEMENT);
|
||||
gReplacementHonourOptOut = !args.GetBoolArg("-mempoolfullrbf", DEFAULT_MEMPOOL_FULL_RBF);
|
||||
if ((!gEnableReplacement) && args.IsArgSet("-mempoolreplacement")) {
|
||||
// Minimal effort at forwards compatibility
|
||||
std::string replacement_opt = args.GetArg("-mempoolreplacement", ""); // default is impossible
|
||||
std::vector<std::string> replacement_modes = util::SplitString(replacement_opt, ",");
|
||||
std::vector<std::string> replacement_modes = util::SplitString(replacement_opt, ",+");
|
||||
gEnableReplacement = (std::find(replacement_modes.begin(), replacement_modes.end(), "fee") != replacement_modes.end());
|
||||
if (gEnableReplacement) {
|
||||
for (auto& opt : replacement_modes) {
|
||||
if (opt == "optin") {
|
||||
gReplacementHonourOptOut = true;
|
||||
} else if (opt == "-optin") {
|
||||
gReplacementHonourOptOut = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gReplacementHonourOptOut = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Also report errors from parsing before daemonization
|
||||
@ -1540,6 +1554,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
|
||||
CTxMemPool::Options mempool_opts{
|
||||
.check_ratio = chainparams.DefaultConsistencyChecks() ? 1 : 0,
|
||||
.full_rbf = !gReplacementHonourOptOut,
|
||||
.signals = &validation_signals,
|
||||
};
|
||||
auto result{ApplyArgsManOptions(args, chainparams, mempool_opts)};
|
||||
|
Loading…
Reference in New Issue
Block a user