From 627959adffe6bc8aba964ce202fcaad0b27dd630 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 17 Aug 2013 14:44:43 -0500 Subject: [PATCH] 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. --- config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.go b/config.go index d782f097..2d6b8245 100644 --- a/config.go +++ b/config.go @@ -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 {