aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorAkio Nakamura <nakamura@dgtechnologies.co.jp>2018-11-12 11:06:36 +0900
committerAkio Nakamura <nakamura@dgtechnologies.co.jp>2018-11-20 18:28:16 +0900
commit3fb09b9889665a24b34f25e9d1385a05058a28b7 (patch)
tree22584858721f4dfbeb637fdc3238858a92d2f9db /src/init.cpp
parent1b99d153d0713ec62b3bde7adbe78c271b5a36ea (diff)
Warn unrecognized sections in the config file
In the config file, sections are specified by square bracket pair "[]"$, or included in the option name itself which separated by a period"(.)". Typicaly, [testnet] is not a correct section name and specified options in that section are ignored but user cannot recognize what is happen. So, add some log/stderr-warning messages if unrecognized section names are present in the config file after checking section only args.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3ab97be329..d6f04bea14 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -803,7 +803,15 @@ void 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.
- gArgs.WarnForSectionOnlyArgs();
+ 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(_("Section [%s] is not recognized."), section));
+ }
}
static std::string ResolveErrMsg(const char * const optname, const std::string& strBind)