Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | #endif | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-dbbatchsize", | "-dbbatchsize", | ||||
strprintf("Maximum database write batch size in bytes (default: %u)", | strprintf("Maximum database write batch size in bytes (default: %u)", | ||||
nDefaultDbBatchSize), | nDefaultDbBatchSize), | ||||
ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, | ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-dbcache=<n>", | "-dbcache=<n>", | ||||
strprintf( | strprintf("Set database cache size in MiB (%d to %d, default: %d)", | ||||
"Set database cache size in megabytes (%d to %d, default: %d)", | |||||
nMinDbCache, nMaxDbCache, nDefaultDbCache), | nMinDbCache, nMaxDbCache, nDefaultDbCache), | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-debuglogfile=<file>", | gArgs.AddArg("-debuglogfile=<file>", | ||||
strprintf("Specify location of debug log file. Relative paths " | strprintf("Specify location of debug log file. Relative paths " | ||||
"will be prefixed by a net-specific datadir " | "will be prefixed by a net-specific datadir " | ||||
"location. (0 to disable; default: %s)", | "location. (0 to disable; default: %s)", | ||||
DEFAULT_DEBUGLOGFILE), | DEFAULT_DEBUGLOGFILE), | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-feefilter", | gArgs.AddArg("-feefilter", | ||||
▲ Show 20 Lines • Show All 1,405 Lines • ▼ Show 20 Lines | #endif | ||||
} else if (nPruneTarget) { | } else if (nPruneTarget) { | ||||
if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES) { | if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES) { | ||||
return InitError( | return InitError( | ||||
strprintf(_("Prune configured below the minimum of %d MiB. " | strprintf(_("Prune configured below the minimum of %d MiB. " | ||||
"Please use a higher number.") | "Please use a higher number.") | ||||
.translated, | .translated, | ||||
MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024)); | MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024)); | ||||
} | } | ||||
LogPrintf("Prune configured to target %uMiB on disk for block and undo " | LogPrintf("Prune configured to target %u MiB on disk for block and " | ||||
"files.\n", | "undo files.\n", | ||||
nPruneTarget / 1024 / 1024); | nPruneTarget / 1024 / 1024); | ||||
fPruneMode = true; | fPruneMode = true; | ||||
} | } | ||||
nConnectTimeout = gArgs.GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT); | nConnectTimeout = gArgs.GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT); | ||||
if (nConnectTimeout <= 0) { | if (nConnectTimeout <= 0) { | ||||
nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; | nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 491 Lines • ▼ Show 20 Lines | #endif | ||||
// 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) * 1000000; | ||||
LogPrintf("Cache configuration:\n"); | LogPrintf("Cache configuration:\n"); | ||||
LogPrintf("* Using %.1fMiB for block index database\n", | LogPrintf("* Using %.1f MiB for block index database\n", | ||||
nBlockTreeDBCache * (1.0 / 1024 / 1024)); | nBlockTreeDBCache * (1.0 / 1024 / 1024)); | ||||
if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { | if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { | ||||
LogPrintf("* Using %.1fMiB for transaction index database\n", | LogPrintf("* Using %.1f MiB for transaction index database\n", | ||||
nTxIndexCache * (1.0 / 1024 / 1024)); | nTxIndexCache * (1.0 / 1024 / 1024)); | ||||
} | } | ||||
for (BlockFilterType filter_type : g_enabled_filter_types) { | for (BlockFilterType filter_type : g_enabled_filter_types) { | ||||
LogPrintf("* Using %.1f MiB for %s block filter index database\n", | LogPrintf("* Using %.1f MiB for %s block filter index database\n", | ||||
filter_index_cache * (1.0 / 1024 / 1024), | filter_index_cache * (1.0 / 1024 / 1024), | ||||
BlockFilterTypeName(filter_type)); | BlockFilterTypeName(filter_type)); | ||||
} | } | ||||
LogPrintf("* Using %.1fMiB for chain state database\n", | LogPrintf("* Using %.1f MiB 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 %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of " | ||||
"unused mempool space)\n", | "unused mempool space)\n", | ||||
nCoinCacheUsage * (1.0 / 1024 / 1024), | nCoinCacheUsage * (1.0 / 1024 / 1024), | ||||
nMempoolSizeMax * (1.0 / 1024 / 1024)); | nMempoolSizeMax * (1.0 / 1024 / 1024)); | ||||
bool fLoaded = false; | bool fLoaded = false; | ||||
while (!fLoaded && !ShutdownRequested()) { | while (!fLoaded && !ShutdownRequested()) { | ||||
const bool fReset = fReindex; | const bool fReset = fReindex; | ||||
std::string strLoadError; | std::string strLoadError; | ||||
▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines |