aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-09 21:13:58 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-04-09 21:14:49 -0400
commit5392aee64fa2d143887be0d06363a7a5ea6a551a (patch)
tree4d17211ddc4e1c5d54ddb605883a8743e621859a /src/init.cpp
parent93de9abe6d6847bce6db8da15f15b50b01972e70 (diff)
parentfae38c3dc6a2dc633c236a0c27ca5a642767033e (diff)
downloadbitcoin-5392aee64fa2d143887be0d06363a7a5ea6a551a.tar.xz
Merge #15629: init: Throw error when network specific config is ignored
fae38c3dc6 doc: Fix all typos reported by codespell (MarcoFalke) fa9058f0ed doc: Add release notes for 15629 (MarcoFalke) fa4a922d78 qa: Add test for missing testnet section in conf file (MarcoFalke) dddd6f0f58 init: Throw error when network specific config is ignored (MarcoFalke) Pull request description: This should have no effect on mainnet users, but simplifies testing, where config settings are currently ignored with only a warning. Fix this by making it an error. Issues: * bitcoin client 0.17.0 ignores wallet's name (file) #14523 * Can't set custom rpcport on testnet #13777 * ... ACKs for commit fae38c: Tree-SHA512: 2e209526898eea6e444c803ec2666989cee4ca137492d32984998733c50a70056cb54657df8dc3027a6a0612738a8afce0bc35824b868c5f22281e00e0188530
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 6564ce5b9a..ec8800ef07 100644
--- a/src/init.cpp
+++ b/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()));
}