File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -790,6 +790,14 @@ void ArgsManager::ReadConfigFiles()
790
790
includeconf.insert (includeconf.end (), includeconf_net.begin (), includeconf_net.end ());
791
791
}
792
792
793
+ // Remove -includeconf from configuration, so we can warn about recursion
794
+ // later
795
+ {
796
+ LOCK (cs_args);
797
+ m_config_args.erase (" -includeconf" );
798
+ m_config_args.erase (std::string (" -" ) + GetChainName () + " .includeconf" );
799
+ }
800
+
793
801
for (const std::string& to_include : includeconf) {
794
802
fs::ifstream include_config (GetConfigFile (to_include));
795
803
if (include_config.good ()) {
@@ -799,6 +807,16 @@ void ArgsManager::ReadConfigFiles()
799
807
fprintf (stderr, " Failed to include configuration file %s\n " , to_include.c_str ());
800
808
}
801
809
}
810
+
811
+ // Warn about recursive -includeconf
812
+ includeconf = GetArgs (" -includeconf" );
813
+ {
814
+ std::vector<std::string> includeconf_net (GetArgs (std::string (" -" ) + GetChainName () + " .includeconf" ));
815
+ includeconf.insert (includeconf.end (), includeconf_net.begin (), includeconf_net.end ());
816
+ }
817
+ for (const std::string& to_include : includeconf) {
818
+ fprintf (stderr, " warning: -includeconf cannot be used from included files; ignoring -includeconf=%s\n " , to_include.c_str ());
819
+ }
802
820
}
803
821
}
804
822
You can’t perform that action at this time.
0 commit comments