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:
parent
60779ea8df
commit
627959adff
1 changed files with 5 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue