diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-11-21 16:43:46 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-11-21 19:37:22 +0100 |
| commit | d7b0258ff037ae90f60a86fc68cb55069c96e8d0 (patch) | |
| tree | 0b8ac15c23276ad49cd10e6df59e92510cbab770 /src/init.cpp | |
| parent | Merge #14719: qa: Check specific reject reasons in feature_block (diff) | |
| parent | Warn unrecognized sections in the config file (diff) | |
| download | discoin-d7b0258ff037ae90f60a86fc68cb55069c96e8d0.tar.xz discoin-d7b0258ff037ae90f60a86fc68cb55069c96e8d0.zip | |
Merge #14708: Warn unrecognised sections in the config file
3fb09b9889665a24b34f25e9d1385a05058a28b7 Warn unrecognized sections in the config file (Akio Nakamura)
Pull request description:
This PR intends to resolve #14702.
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-warning messages if unrecognized section names are
present in the config file after checking section only args.
note: Currentry, followings are out of scope of this PR.
1) Empty section name or option name can describe.
e.g. [] , .a=b, =c
2) Multiple period characters can exist in the section name and option name.
e.g. [c.d.e], [..], f.g.h.i=j, ..=k
Tree-SHA512: 2cea02a0525feb40320613989a75cd7b7b1bd12158d5e6f3174ca77e6a25bb84425dd8812f62483df9fc482045c7b5402d69bc714430518b1847d055a2dc304b
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 3ab97be32..d6f04bea1 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) |