multi: Added a NetInterface to clean up config.go

This commit adds a new interface named NetInterface and two
implementations of it: RegularNet & TorProxyNet. These two structs
are used in config.go in an attempt to clean up the code and
abstract away the dialer and DNS functions.
This commit is contained in:
nsa authored and Olaoluwa Osuntokun committed 2018-02-05 17:37:46 -08:00
1 parent e132ad8433
commit 8c482f2be7
6 files changed
+99 -87

No files matched your search

+1 -1
View File
@@ -590,7 +590,7 @@ func (r *rpcServer) ConnectPeer(ctx context.Context,
}
// We use lndResolveTCP here in case we wish to resolve hosts over Tor.
host, err := lndResolveTCP("tcp", addr)
host, err := cfg.net.ResolveTCPAddr("tcp", addr)
if err != nil {
return nil, err
}