Skip to content

Commit

Permalink
Remove includeconf nested scope
Browse files Browse the repository at this point in the history
Easier to review ignoring whitespace

Suggestion from John Newbery <john@johnnewbery.com> in
bitcoin#15934 (comment)
  • Loading branch information
ryanofsky authored and sidhujag committed Nov 9, 2019
1 parent 33f7a4b commit c0c2bcd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/util/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,15 +1018,13 @@ bool ArgsManager::ReadConfigFiles(std::string& error, bool ignore_invalid_keys)

// Warn about recursive -includeconf
conf_file_names = GetArgs("-includeconf");
{
std::vector<std::string> includeconf_net(GetArgs(std::string("-") + chain_id + ".includeconf"));
std::vector<std::string> includeconf_net(GetArgs(std::string("-") + chain_id + ".includeconf"));
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
std::string chain_id_final = GetChainName();
if (chain_id_final != chain_id) {
// Also warn about recursive includeconf for the chain that was specified in one of the includeconfs
includeconf_net = GetArgs(std::string("-") + chain_id_final + ".includeconf");
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
std::string chain_id_final = GetChainName();
if (chain_id_final != chain_id) {
// Also warn about recursive includeconf for the chain that was specified in one of the includeconfs
includeconf_net = GetArgs(std::string("-") + chain_id_final + ".includeconf");
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
}
}
for (const std::string& conf_file_name : conf_file_names) {
tfm::format(std::cerr, "warning: -includeconf cannot be used from included files; ignoring -includeconf=%s\n", conf_file_name);
Expand Down

0 comments on commit c0c2bcd

Please sign in to comment.