Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 440 Lines • ▼ Show 20 Lines | #endif | ||||
strUsage += | strUsage += | ||||
HelpMessageOpt("-connect=<ip>", | HelpMessageOpt("-connect=<ip>", | ||||
_("Connect only to the specified node(s); -noconnect or " | _("Connect only to the specified node(s); -noconnect or " | ||||
"-connect=0 alone to disable automatic connections")); | "-connect=0 alone to disable automatic connections")); | ||||
strUsage += HelpMessageOpt("-discover", | strUsage += HelpMessageOpt("-discover", | ||||
_("Discover own IP addresses (default: 1 when " | _("Discover own IP addresses (default: 1 when " | ||||
"listening and no -externalip or -proxy)")); | "listening and no -externalip or -proxy)")); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-dns", _("Allow DNS lookups for -addnode, -seednode and -connect") + | "-dns", | ||||
" " + strprintf(_("(default: %d)"), DEFAULT_NAME_LOOKUP)); | _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + | ||||
strprintf(_("(default: %d)"), DEFAULT_NAME_LOOKUP)); | |||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-dnsseed", _("Query for peer addresses via DNS lookup, if low on " | "-dnsseed", _("Query for peer addresses via DNS lookup, if low on " | ||||
"addresses (default: 1 unless -connect/-noconnect)")); | "addresses (default: 1 unless -connect/-noconnect)")); | ||||
strUsage += HelpMessageOpt("-externalip=<ip>", | strUsage += HelpMessageOpt("-externalip=<ip>", | ||||
_("Specify your own public address")); | _("Specify your own public address")); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-forcednsseed", | "-forcednsseed", | ||||
strprintf( | strprintf( | ||||
▲ Show 20 Lines • Show All 1,424 Lines • ▼ Show 20 Lines | #endif | ||||
// cache size calculations | // cache size calculations | ||||
int64_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20); | int64_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20); | ||||
// total cache cannot be less than nMinDbCache | // total cache cannot be less than nMinDbCache | ||||
nTotalCache = std::max(nTotalCache, nMinDbCache << 20); | nTotalCache = std::max(nTotalCache, nMinDbCache << 20); | ||||
// total cache cannot be greater than nMaxDbcache | // total cache cannot be greater than nMaxDbcache | ||||
nTotalCache = std::min(nTotalCache, nMaxDbCache << 20); | nTotalCache = std::min(nTotalCache, nMaxDbCache << 20); | ||||
int64_t nBlockTreeDBCache = nTotalCache / 8; | int64_t nBlockTreeDBCache = nTotalCache / 8; | ||||
nBlockTreeDBCache = | nBlockTreeDBCache = std::min(nBlockTreeDBCache, | ||||
std::min(nBlockTreeDBCache, (GetBoolArg("-txindex", DEFAULT_TXINDEX) | (GetBoolArg("-txindex", DEFAULT_TXINDEX) | ||||
? nMaxBlockDBAndTxIndexCache | ? nMaxBlockDBAndTxIndexCache | ||||
: nMaxBlockDBCache) | : nMaxBlockDBCache) | ||||
<< 20); | << 20); | ||||
nTotalCache -= nBlockTreeDBCache; | nTotalCache -= nBlockTreeDBCache; | ||||
// use 25%-50% of the remainder for disk cache | // use 25%-50% of the remainder for disk cache | ||||
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 | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | while (!fLoaded) { | ||||
if (!fLoaded) { | if (!fLoaded) { | ||||
// first suggest a reindex | // first suggest a reindex | ||||
if (!fReset) { | if (!fReset) { | ||||
bool fRet = uiInterface.ThreadSafeQuestion( | bool fRet = uiInterface.ThreadSafeQuestion( | ||||
strLoadError + ".\n\n" + | strLoadError + ".\n\n" + | ||||
_("Do you want to rebuild the block database now?"), | _("Do you want to rebuild the block database now?"), | ||||
strLoadError + ".\nPlease restart with -reindex or " | strLoadError + ".\nPlease restart with -reindex or " | ||||
"-reindex-chainstate to recover.", | "-reindex-chainstate to recover.", | ||||
"", CClientUIInterface::MSG_ERROR | | "", | ||||
CClientUIInterface::MSG_ERROR | | |||||
CClientUIInterface::BTN_ABORT); | CClientUIInterface::BTN_ABORT); | ||||
if (fRet) { | if (fRet) { | ||||
fReindex = true; | fReindex = true; | ||||
fRequestShutdown = false; | fRequestShutdown = false; | ||||
} else { | } else { | ||||
LogPrintf("Aborted block database rebuild. Exiting.\n"); | LogPrintf("Aborted block database rebuild. Exiting.\n"); | ||||
return false; | return false; | ||||
} | } | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |