Ignore config file addpeer entries with --regtest.

When running in regression test mode, it is unlikely the user wants to
connect to permanent peers they have configured in their config file.
This commit modifies the code to ignore the config file entry when in
regression test mode.  The user can still provide -a (or --addpeer) on the
command line to override this if they really want to connect out to a
specific peer during regression test mode.
This commit is contained in:
Dave Collins 2013-08-17 14:44:43 -05:00
parent 60779ea8df
commit 627959adff

View file

@ -216,6 +216,11 @@ 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 {
cfg.AddPeers = nil
}
// Parse command line options again to ensure they take precedence.
remainingArgs, err := parser.Parse()
if err != nil {