38 mempool_limits.descendant_count = argsman.GetIntArg("-limitdescendantcount", mempool_limits.descendant_count); 40 if (auto vkb = argsman.GetIntArg("-limitdescendantsize")) mempool_limits.descendant_size_vbytes = *vkb * 1'000;
48 if (
auto mb = argsman.
GetIntArg(
"-maxmempool")) {
49 constexpr
bool is_32bit{
sizeof(
void*) == 4};
56 if (
auto hours = argsman.
GetIntArg(
"-mempoolexpiry")) mempool_opts.
expiry = std::chrono::hours{*hours};
60 if (argsman.
IsArgSet(
"-incrementalrelayfee")) {
61 if (std::optional<CAmount> inc_relay_fee =
ParseMoney(argsman.
GetArg(
"-incrementalrelayfee",
""))) {
62 mempool_opts.incremental_relay_feerate =
CFeeRate{inc_relay_fee.value()};
69 if (argsman.
IsArgSet(
"-minrelaytxfee")) {
70 if (std::optional<CAmount> min_relay_feerate =
ParseMoney(argsman.
GetArg(
"-minrelaytxfee",
""))) {
72 mempool_opts.min_relay_feerate =
CFeeRate{min_relay_feerate.value()};
76 }
else if (mempool_opts.incremental_relay_feerate > mempool_opts.min_relay_feerate) {
78 mempool_opts.min_relay_feerate = mempool_opts.incremental_relay_feerate;
79 LogPrintf(
"Increasing minrelaytxfee to %s to match incrementalrelayfee\n", mempool_opts.min_relay_feerate.ToString());
84 if (argsman.
IsArgSet(
"-dustrelayfee")) {
85 if (std::optional<CAmount> parsed =
ParseMoney(argsman.
GetArg(
"-dustrelayfee",
""))) {
86 mempool_opts.dust_relay_feerate =
CFeeRate{parsed.value()};
97 mempool_opts.max_datacarrier_bytes = std::nullopt;
101 if (!chainparams.IsTestChain() && !mempool_opts.require_standard) {
105 mempool_opts.persist_v1_dat = argsman.
GetBoolArg(
"-persistmempoolv1", mempool_opts.persist_v1_dat);
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
static constexpr unsigned int DEFAULT_INCREMENTAL_RELAY_FEE
Default for -incrementalrelayfee, which sets the minimum feerate increase for mempool limiting or rep...
static const unsigned int MAX_OP_RETURN_RELAY
Default setting for -datacarriersize.
is a home for simple string functions returning descriptive messages that are used in RPC and GUI int...
Options struct containing limit options for a CTxMemPool.
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
static constexpr unsigned int DEFAULT_MIN_RELAY_TX_FEE
Default for -minrelaytxfee, minimum relay fee for transactions.
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
static constexpr bool DEFAULT_PERMIT_BAREMULTISIG
Default for -permitbaremultisig.
std::chrono::seconds expiry
util::Result< void > ApplyArgsManOptions(const ArgsManager &argsman, const CChainParams &chainparams, MemPoolOptions &mempool_opts)
Overlay the options set in argsman on top of corresponding members in mempool_opts.
bilingual_str AmountErrMsg(const std::string &optname, const std::string &strValue)
std::optional< CAmount > ParseMoney(const std::string &money_string)
Parse an amount denoted in full coins.
int64_t ancestor_size_vbytes
The maximum allowed size in virtual bytes of an entry and its ancestors within a package.
static constexpr int MAX_32BIT_MEMPOOL_MB
Maximum mempool size on 32-bit systems.
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
static constexpr bool DEFAULT_ACCEPT_NON_STD_TXN
Default for -acceptnonstdtxn.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
Options struct containing options for constructing a CTxMemPool.
int64_t ancestor_count
The maximum allowed number of transactions in a package including the entry and its ancestors...
static const bool DEFAULT_ACCEPT_DATACARRIER
Default for -datacarrier.