Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,676 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool AppInitParameterInteraction(Config &config) { | bool AppInitParameterInteraction(Config &config) { | ||||
const CChainParams &chainparams = config.GetChainParams(); | const CChainParams &chainparams = config.GetChainParams(); | ||||
// Step 2: parameter interactions | // Step 2: parameter interactions | ||||
// also see: InitParameterInteraction() | // also see: InitParameterInteraction() | ||||
// Warn if network-specific options (-addnode, -connect, etc) are | // Error if network-specific options (-addnode, -connect, etc) are | ||||
// specified in default section of config file, but not overridden | // specified in default section of config file, but not overridden | ||||
// on the command line or in this network's section of the config file. | // on the command line or in this network's section of the config file. | ||||
std::string network = gArgs.GetChainName(); | std::string network = gArgs.GetChainName(); | ||||
bilingual_str errors; | |||||
for (const auto &arg : gArgs.GetUnsuitableSectionOnlyArgs()) { | for (const auto &arg : gArgs.GetUnsuitableSectionOnlyArgs()) { | ||||
return InitError(strprintf(_("Config setting for %s only applied on %s " | errors += strprintf(_("Config setting for %s only applied on %s " | ||||
"network when in [%s] section."), | "network when in [%s] section.") + | ||||
arg, network, network)); | Untranslated("\n"), | ||||
arg, network, network); | |||||
} | |||||
if (!errors.empty()) { | |||||
return InitError(errors); | |||||
} | } | ||||
// Warn if unrecognized section name are present in the config file. | // Warn if unrecognized section name are present in the config file. | ||||
bilingual_str warnings; | |||||
for (const auto §ion : gArgs.GetUnrecognizedSections()) { | for (const auto §ion : gArgs.GetUnrecognizedSections()) { | ||||
InitWarning(strprintf(Untranslated("%s:%i ") + | warnings += strprintf(Untranslated("%s:%i ") + | ||||
_("Section [%s] is not recognized."), | _("Section [%s] is not recognized.") + | ||||
section.m_file, section.m_line, section.m_name)); | Untranslated("\n"), | ||||
section.m_file, section.m_line, section.m_name); | |||||
} | |||||
if (!warnings.empty()) { | |||||
InitWarning(warnings); | |||||
} | } | ||||
if (!fs::is_directory(GetBlocksDir())) { | if (!fs::is_directory(GetBlocksDir())) { | ||||
return InitError( | return InitError( | ||||
strprintf(_("Specified blocks directory \"%s\" does not exist."), | strprintf(_("Specified blocks directory \"%s\" does not exist."), | ||||
gArgs.GetArg("-blocksdir", ""))); | gArgs.GetArg("-blocksdir", ""))); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,205 Lines • Show Last 20 Lines |