diff --git a/chainregistry.go b/chainregistry.go index 9bd09b55..7cbed86e 100644 --- a/chainregistry.go +++ b/chainregistry.go @@ -174,6 +174,27 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB, ChainParams: *activeNetParams.Params, AddPeers: cfg.NeutrinoMode.AddPeers, ConnectPeers: cfg.NeutrinoMode.ConnectPeers, + Dialer: func(addr net.Addr) (net.Conn, error) { + return cfg.net.Dial(addr.Network(), addr.String()) + }, + NameResolver: func(host string) ([]net.IP, error) { + addrs, err := cfg.net.LookupHost(host) + if err != nil { + return nil, err + } + + ips := make([]net.IP, 0, len(addrs)) + for _, strIP := range addrs { + ip := net.ParseIP(strIP) + if ip == nil { + continue + } + + ips = append(ips, ip) + } + + return ips, nil + }, } neutrino.WaitForMoreCFHeaders = time.Second * 1 neutrino.MaxPeers = 8 diff --git a/lnd.go b/lnd.go index 09532fb6..9f4e10f8 100644 --- a/lnd.go +++ b/lnd.go @@ -251,6 +251,13 @@ func lndMain() error { } idPrivKey.Curve = btcec.S256() + if cfg.Tor.Socks != "" && cfg.Tor.DNS != "" { + srvrLog.Infof("Proxying all network traffic via Tor "+ + "(stream_isolation=%v)! NOTE: If running with a full-node "+ + "backend, ensure that is proxying over Tor as well", + cfg.Tor.StreamIsolation) + } + // Set up the core server which will listen for incoming peer // connections. server, err := newServer(cfg.Listeners, chanDB, activeChainControl,