Don't load default config file in regtest mode.

The regression test mode is special and therefore most likely will not
want to use the same settings that are in the configuration file.  The -C
option can still be used to specify a config file in regression test mode
if desired.
This commit is contained in:
Dave Collins 2013-11-15 14:42:53 -06:00
parent 527a08eb14
commit 6b8c10d1fb

View file

@ -225,6 +225,7 @@ func loadConfig() (*config, []string, error) {
// Load additional config from file.
parser := flags.NewParser(&cfg, flags.Default)
if !preCfg.RegressionTest || preCfg.ConfigFile != defaultConfigFile {
err := parser.ParseIniFile(preCfg.ConfigFile)
if err != nil {
if _, ok := err.(*os.PathError); !ok {
@ -234,6 +235,7 @@ func loadConfig() (*config, []string, error) {
}
log.Warnf("%v", err)
}
}
// Don't add peers from the config file when in regression test mode.
if preCfg.RegressionTest && len(cfg.AddPeers) > 0 {