From 90b5a642260721bbb3be584eb4d67fc76411f15a Mon Sep 17 00:00:00 2001 From: Otto Suess Date: Wed, 15 Aug 2018 16:39:22 +0200 Subject: [PATCH] fix: segmentation violation crash --- config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index b3f79a5..c26f8d1 100644 --- a/config.go +++ b/config.go @@ -19,6 +19,7 @@ import ( "github.com/lightningnetwork/lnd/htlcswitch/hodl" "github.com/lightningnetwork/lnd/lncfg" "github.com/lightningnetwork/lnd/lnwire" + "github.com/lightningnetwork/lnd/tor" ) const ( @@ -217,6 +218,8 @@ type config struct { NoNetBootstrap bool `long:"nobootstrap" description:"If true, then automatic network bootstrapping will not be attempted."` NoEncryptWallet bool `long:"noencryptwallet" description:"If set, wallet will be encrypted using the default passphrase."` + + net tor.Net } // loadConfig initializes and parses the config using a config file and command @@ -281,6 +284,7 @@ func loadConfig() (*config, error) { MinChannelSize: int64(0), MaxChannelSize: int64(0), }, + net: &tor.ClearNet{}, } // Pre-parse the command line options to pick up an alternative config @@ -348,7 +352,7 @@ func loadConfig() (*config, error) { // duplicate addresses. cfg.RPCListeners, err = lncfg.NormalizeAddresses( cfg.RawRPCListeners, strconv.Itoa(defaultRPCPort), - nil, + cfg.net.ResolveTCPAddr, ) if err != nil { return nil, err