Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 395 Lines • ▼ Show 20 Lines | strUsage += HelpMessageOpt( | ||||
"path or a path relative to the data directory (default: %s)"), | "path or a path relative to the data directory (default: %s)"), | ||||
DEFAULT_DEBUGLOGFILE)); | DEFAULT_DEBUGLOGFILE)); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-maxorphantx=<n>", strprintf(_("Keep at most <n> unconnectable " | "-maxorphantx=<n>", strprintf(_("Keep at most <n> unconnectable " | ||||
"transactions in memory (default: %u)"), | "transactions in memory (default: %u)"), | ||||
DEFAULT_MAX_ORPHAN_TRANSACTIONS)); | DEFAULT_MAX_ORPHAN_TRANSACTIONS)); | ||||
strUsage += HelpMessageOpt("-maxmempool=<n>", | strUsage += HelpMessageOpt("-maxmempool=<n>", | ||||
strprintf(_("Keep the transaction memory pool " | strprintf(_("Keep the transaction memory pool " | ||||
"below <n> megabytes (default: %u)"), | "below <n> bytes (default: %u)"), | ||||
DEFAULT_MAX_MEMPOOL_SIZE)); | DEFAULT_MAX_MEMPOOL_SIZE)); | ||||
strUsage += | strUsage += | ||||
HelpMessageOpt("-mempoolexpiry=<n>", | HelpMessageOpt("-mempoolexpiry=<n>", | ||||
strprintf(_("Do not keep transactions in the mempool " | strprintf(_("Do not keep transactions in the mempool " | ||||
"longer than <n> hours (default: %u)"), | "longer than <n> hours (default: %u)"), | ||||
DEFAULT_MEMPOOL_EXPIRY)); | DEFAULT_MEMPOOL_EXPIRY)); | ||||
if (showDebug) { | if (showDebug) { | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
▲ Show 20 Lines • Show All 1,121 Lines • ▼ Show 20 Lines | bool AppInitParameterInteraction(Config &config, RPCServer &rpcServer) { | ||||
if (nMinimumChainWork < | if (nMinimumChainWork < | ||||
UintToArith256(chainparams.GetConsensus().nMinimumChainWork)) { | UintToArith256(chainparams.GetConsensus().nMinimumChainWork)) { | ||||
LogPrintf("Warning: nMinimumChainWork set below default value of %s\n", | LogPrintf("Warning: nMinimumChainWork set below default value of %s\n", | ||||
chainparams.GetConsensus().nMinimumChainWork.GetHex()); | chainparams.GetConsensus().nMinimumChainWork.GetHex()); | ||||
} | } | ||||
// mempool limits | // mempool limits | ||||
int64_t nMempoolSizeMax = | int64_t nMempoolSizeMax = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); | ||||
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))); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 468 Lines • ▼ Show 20 Lines | #endif | ||||
int64_t nCoinDBCache = | int64_t nCoinDBCache = | ||||
std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); | std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); | ||||
// cap total coins db cache | // cap total coins db cache | ||||
nCoinDBCache = std::min(nCoinDBCache, nMaxCoinsDBCache << 20); | nCoinDBCache = std::min(nCoinDBCache, nMaxCoinsDBCache << 20); | ||||
nTotalCache -= nCoinDBCache; | nTotalCache -= nCoinDBCache; | ||||
// the rest goes to in-memory cache | // the rest goes to in-memory cache | ||||
nCoinCacheUsage = nTotalCache; | nCoinCacheUsage = nTotalCache; | ||||
int64_t nMempoolSizeMax = | int64_t nMempoolSizeMax = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); | ||||
LogPrintf("Cache configuration:\n"); | LogPrintf("Cache configuration:\n"); | ||||
LogPrintf("* Using %.1fMiB for block index database\n", | LogPrintf("* Using %.1fMiB for block index database\n", | ||||
nBlockTreeDBCache * (1.0 / 1024 / 1024)); | nBlockTreeDBCache * (1.0 / 1024 / 1024)); | ||||
LogPrintf("* Using %.1fMiB for chain state database\n", | LogPrintf("* Using %.1fMiB for chain state database\n", | ||||
nCoinDBCache * (1.0 / 1024 / 1024)); | nCoinDBCache * (1.0 / 1024 / 1024)); | ||||
LogPrintf("* Using %.1fMiB for in-memory UTXO set (plus up to %.1fMiB of " | LogPrintf("* Using %.1fMiB for in-memory UTXO set (plus up to %.1fMiB of " | ||||
"unused mempool space)\n", | "unused mempool space)\n", | ||||
nCoinCacheUsage * (1.0 / 1024 / 1024), | nCoinCacheUsage * (1.0 / 1024 / 1024), | ||||
▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines |