server+tor: add support for Tor HASHEDPASSWORD authentication method

This provides users an alternative over the SAFECOOKIE authentication
method, which may not be as useful if users are connecting to a remote
Tor sevrer due to lnd not being able to retrieve the cookie file.
This commit is contained in:
Tomas Carnecky
2019-10-26 11:00:57 +02:00
committed by Wilmer Paulino
parent 42e65d4ae5
commit 018e8b5b97
5 changed files with 147 additions and 84 deletions

View File

@@ -586,7 +586,10 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB,
// automatically create an onion service, we'll initiate our Tor
// controller and establish a connection to the Tor server.
if cfg.Tor.Active && (cfg.Tor.V2 || cfg.Tor.V3) {
s.torController = tor.NewController(cfg.Tor.Control, cfg.Tor.TargetIPAddress)
s.torController = tor.NewController(
cfg.Tor.Control, cfg.Tor.TargetIPAddress,
cfg.Tor.Password,
)
}
chanGraph := chanDB.ChannelGraph()