mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
config+lnd: Update Tor configuration for hybrid node mode
This commit is contained in:
20
lnd.go
20
lnd.go
@@ -8,6 +8,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
@@ -168,6 +169,10 @@ type ListenerCfg struct {
|
||||
ExternalRestRegistrar RestRegistrar
|
||||
}
|
||||
|
||||
var errStreamIsolationWithDirectConnections = errors.New(
|
||||
"direct connections cannot be used while stream isolation is enabled",
|
||||
)
|
||||
|
||||
// Main is the true entry point for lnd. It accepts a fully populated and
|
||||
// validated main configuration struct and an optional listener config struct.
|
||||
// This function starts all main system components then blocks until a signal
|
||||
@@ -752,10 +757,19 @@ func Main(cfg *Config, lisCfg ListenerCfg, interceptor signal.Interceptor) error
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.Tor.StreamIsolation && cfg.Tor.DirectConnections {
|
||||
return errStreamIsolationWithDirectConnections
|
||||
}
|
||||
|
||||
if cfg.Tor.Active {
|
||||
srvrLog.Infof("Proxying all network traffic via Tor "+
|
||||
"(stream_isolation=%v)! NOTE: Ensure the backend node "+
|
||||
"is proxying over Tor as well", cfg.Tor.StreamIsolation)
|
||||
if cfg.Tor.DirectConnections {
|
||||
srvrLog.Info("Onion services are accessible via Tor! NOTE: " +
|
||||
"Traffic to clearnet services is not routed via Tor.")
|
||||
} else {
|
||||
srvrLog.Infof("Proxying all network traffic via Tor "+
|
||||
"(stream_isolation=%v)! NOTE: Ensure the backend node "+
|
||||
"is proxying over Tor as well", cfg.Tor.StreamIsolation)
|
||||
}
|
||||
}
|
||||
|
||||
// If the watchtower client should be active, open the client database.
|
||||
|
Reference in New Issue
Block a user