Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 799 Lines • ▼ Show 20 Lines | if (showDebug) { | ||||
"testnet/regtest only; ", | "testnet/regtest only; ", | ||||
defaultChainParams->RequireStandard())); | defaultChainParams->RequireStandard())); | ||||
strUsage += | strUsage += | ||||
HelpMessageOpt("-excessiveblocksize=<n>", | HelpMessageOpt("-excessiveblocksize=<n>", | ||||
strprintf(_("Do not accept blocks larger than this " | strprintf(_("Do not accept blocks larger than this " | ||||
"limit, in bytes (default: %d)"), | "limit, in bytes (default: %d)"), | ||||
DEFAULT_MAX_BLOCK_SIZE)); | DEFAULT_MAX_BLOCK_SIZE)); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-incrementalrelayfee=<amt>", | |||||
strprintf( | |||||
"Fee rate (in %s/kB) used to define cost of relay, used for " | |||||
"mempool limiting and BIP 125 replacement. (default: %s)", | |||||
CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE))); | |||||
strUsage += HelpMessageOpt( | |||||
"-dustrelayfee=<amt>", | "-dustrelayfee=<amt>", | ||||
strprintf("Fee rate (in %s/kB) used to defined dust, the value of " | strprintf("Fee rate (in %s/kB) used to defined dust, the value of " | ||||
"an output such that it will cost about 1/3 of its value " | "an output such that it will cost about 1/3 of its value " | ||||
"in fees at this fee rate to spend it. (default: %s)", | "in fees at this fee rate to spend it. (default: %s)", | ||||
CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE))); | CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE))); | ||||
} | } | ||||
strUsage += | strUsage += | ||||
HelpMessageOpt("-bytespersigop", | HelpMessageOpt("-bytespersigop", | ||||
▲ Show 20 Lines • Show All 660 Lines • ▼ Show 20 Lines | bool AppInitParameterInteraction(Config &config) { | ||||
int64_t nMempoolSizeMax = | int64_t nMempoolSizeMax = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | ||||
int64_t nMempoolSizeMin = | int64_t nMempoolSizeMin = | ||||
gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * | gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * | ||||
1000 * 40; | 1000 * 40; | ||||
if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin) | if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin) | ||||
return InitError(strprintf(_("-maxmempool must be at least %d MB"), | return InitError(strprintf(_("-maxmempool must be at least %d MB"), | ||||
std::ceil(nMempoolSizeMin / 1000000.0))); | std::ceil(nMempoolSizeMin / 1000000.0))); | ||||
// Incremental relay fee sets the minimimum feerate increase necessary for | |||||
// BIP 125 replacement in the mempool and the amount the mempool min fee | |||||
// increases above the feerate of txs evicted due to mempool limiting. | |||||
if (gArgs.IsArgSet("-incrementalrelayfee")) { | |||||
Amount n(0); | |||||
if (!ParseMoney(gArgs.GetArg("-incrementalrelayfee", ""), n)) | |||||
return InitError( | |||||
AmountErrMsg("incrementalrelayfee", | |||||
gArgs.GetArg("-incrementalrelayfee", ""))); | |||||
incrementalRelayFee = CFeeRate(n); | |||||
} | |||||
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency | // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency | ||||
nScriptCheckThreads = gArgs.GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS); | nScriptCheckThreads = gArgs.GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS); | ||||
if (nScriptCheckThreads <= 0) nScriptCheckThreads += GetNumCores(); | if (nScriptCheckThreads <= 0) nScriptCheckThreads += GetNumCores(); | ||||
if (nScriptCheckThreads <= 1) | if (nScriptCheckThreads <= 1) | ||||
nScriptCheckThreads = 0; | nScriptCheckThreads = 0; | ||||
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) | else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) | ||||
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; | nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | #endif | ||||
if (gArgs.IsArgSet("-minrelaytxfee")) { | if (gArgs.IsArgSet("-minrelaytxfee")) { | ||||
Amount n(0); | Amount n(0); | ||||
auto parsed = ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n); | auto parsed = ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n); | ||||
if (!parsed || Amount(0) == n) | if (!parsed || Amount(0) == n) | ||||
return InitError(AmountErrMsg("minrelaytxfee", | return InitError(AmountErrMsg("minrelaytxfee", | ||||
gArgs.GetArg("-minrelaytxfee", ""))); | gArgs.GetArg("-minrelaytxfee", ""))); | ||||
// High fee check is done afterward in CWallet::ParameterInteraction() | // High fee check is done afterward in CWallet::ParameterInteraction() | ||||
::minRelayTxFee = CFeeRate(n); | ::minRelayTxFee = CFeeRate(n); | ||||
} else if (incrementalRelayFee > ::minRelayTxFee) { | |||||
// Allow only setting incrementalRelayFee to control both | |||||
::minRelayTxFee = incrementalRelayFee; | |||||
LogPrintf( | |||||
"Increasing minrelaytxfee to %s to match incrementalrelayfee\n", | |||||
::minRelayTxFee.ToString()); | |||||
} | } | ||||
// Sanity check argument for min fee for including tx in block | // Sanity check argument for min fee for including tx in block | ||||
// TODO: Harmonize which arguments need sanity checking and where that | // TODO: Harmonize which arguments need sanity checking and where that | ||||
// happens. | // happens. | ||||
if (gArgs.IsArgSet("-blockmintxfee")) { | if (gArgs.IsArgSet("-blockmintxfee")) { | ||||
Amount n(0); | Amount n(0); | ||||
if (!ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n)) | if (!ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n)) | ||||
▲ Show 20 Lines • Show All 726 Lines • Show Last 20 Lines |