init: Throw error when network specific config is ignored
This commit is contained in:
parent
81f732bcaa
commit
dddd6f0f58
1 changed files with 13 additions and 13 deletions
26
src/init.cpp
26
src/init.cpp
|
@ -828,19 +828,6 @@ void InitParameterInteraction()
|
|||
if (gArgs.SoftSetBoolArg("-whitelistrelay", true))
|
||||
LogPrintf("%s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1\n", __func__);
|
||||
}
|
||||
|
||||
// Warn if network-specific options (-addnode, -connect, etc) are
|
||||
// specified in default section of config file, but not overridden
|
||||
// on the command line or in this network's section of the config file.
|
||||
std::string network = gArgs.GetChainName();
|
||||
for (const auto& arg : gArgs.GetUnsuitableSectionOnlyArgs()) {
|
||||
InitWarning(strprintf(_("Config setting for %s only applied on %s network when in [%s] section."), arg, network, network));
|
||||
}
|
||||
|
||||
// Warn if unrecognized section name are present in the config file.
|
||||
for (const auto& section : gArgs.GetUnrecognizedSections()) {
|
||||
InitWarning(strprintf("%s:%i " + _("Section [%s] is not recognized."), section.m_file, section.m_line, section.m_name));
|
||||
}
|
||||
}
|
||||
|
||||
static std::string ResolveErrMsg(const char * const optname, const std::string& strBind)
|
||||
|
@ -950,6 +937,19 @@ bool AppInitParameterInteraction()
|
|||
|
||||
// also see: InitParameterInteraction()
|
||||
|
||||
// Warn if network-specific options (-addnode, -connect, etc) are
|
||||
// specified in default section of config file, but not overridden
|
||||
// on the command line or in this network's section of the config file.
|
||||
std::string network = gArgs.GetChainName();
|
||||
for (const auto& arg : gArgs.GetUnsuitableSectionOnlyArgs()) {
|
||||
return InitError(strprintf(_("Config setting for %s only applied on %s network when in [%s] section."), arg, network, network));
|
||||
}
|
||||
|
||||
// Warn if unrecognized section name are present in the config file.
|
||||
for (const auto& section : gArgs.GetUnrecognizedSections()) {
|
||||
InitWarning(strprintf("%s:%i " + _("Section [%s] is not recognized."), section.m_file, section.m_line, section.m_name));
|
||||
}
|
||||
|
||||
if (!fs::is_directory(GetBlocksDir())) {
|
||||
return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist."), gArgs.GetArg("-blocksdir", "").c_str()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue