From 53500127e32f3dc06089359a250994282c27b1f6 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 3 Sep 2017 17:00:05 -0700 Subject: [PATCH] test+config: add new --nobootstrap option to disable connection bootstrapping This commit adds a new config option to allow callers to optionally disable connection bootstrapping. This may be desirable for several reasons, but primary, we add this so we can keep our integration tests under the same context as before bootstrapping existed. --- config.go | 3 +++ networktest.go | 1 + 2 files changed, 4 insertions(+) diff --git a/config.go b/config.go index cc8a7c87..3e4ea4ad 100644 --- a/config.go +++ b/config.go @@ -123,6 +123,8 @@ type config struct { NeutrinoMode *neutrinoConfig `group:"neutrino" namespace:"neutrino"` Autopilot *autoPilotConfig `group:"autopilot" namespace:"autopilot"` + + NoNetBootstrap bool `long:"nobootstrap" description:"If true, then automatic network bootstrapping will not be attempted."` } // loadConfig initializes and parses the config using a config file and command @@ -272,6 +274,7 @@ func loadConfig() (*config, error) { activeNetParams = regTestNetParams } if cfg.Bitcoin.SimNet { + numNets++ activeNetParams = bitcoinSimNetParams } if numNets > 1 { diff --git a/networktest.go b/networktest.go index 7c31a76a..f4ab77e8 100644 --- a/networktest.go +++ b/networktest.go @@ -171,6 +171,7 @@ func (l *lightningNode) genArgs() []string { encodedCert := hex.EncodeToString(l.rpcCert) args = append(args, "--bitcoin.active") args = append(args, "--bitcoin.simnet") + args = append(args, "--nobootstrap") args = append(args, fmt.Sprintf("--bitcoin.rpchost=%v", l.cfg.Bitcoin.RPCHost)) args = append(args, fmt.Sprintf("--bitcoin.rpcuser=%v", l.cfg.Bitcoin.RPCUser)) args = append(args, fmt.Sprintf("--bitcoin.rpcpass=%v", l.cfg.Bitcoin.RPCPass))