tor+server: add OnionStore to AddOnionConfig with file-based impl
In this commit, we modify the AddOnionConfig struct to include an abstract OnionStore, which will be responsible for storing all relevant information of an onion service. We also add a file-based implementation of the interface to maintain the same behavior of storing an onion service's private key in a file.
This commit is contained in:
3 files changed
+145
-26
No files matched your search
@@ -1965,9 +1965,9 @@ func (s *server) initTorController() error {
|
||||
// create our onion service. The service's private key will be saved to
|
||||
// disk in order to regain access to this service when restarting `lnd`.
|
||||
onionCfg := tor.AddOnionConfig{
|
||||
VirtualPort: defaultPeerPort,
|
||||
TargetPorts: listenPorts,
|
||||
PrivateKeyPath: cfg.Tor.PrivateKeyPath,
|
||||
VirtualPort: defaultPeerPort,
|
||||
TargetPorts: listenPorts,
|
||||
Store: tor.NewOnionFile(cfg.Tor.PrivateKeyPath, 0600),
|
||||
}
|
||||
|
||||
switch {
|
||||
|
||||
Reference in new issue
Block a user