diff --git a/lnrpc/wtclientrpc/config.go b/lnrpc/wtclientrpc/config.go index 8796bd05..9127c084 100644 --- a/lnrpc/wtclientrpc/config.go +++ b/lnrpc/wtclientrpc/config.go @@ -19,6 +19,10 @@ type Config struct { // through the watchtower RPC subserver. Client wtclient.Client + // AnchorClient is the backing watchtower client for anchor channels that + // we'll interact through the watchtower RPC subserver. + AnchorClient wtclient.Client + // Resolver is a custom resolver that will be used to resolve watchtower // addresses to ensure we don't leak any information when running over // non-clear networks, e.g. Tor, etc. diff --git a/rpcserver.go b/rpcserver.go index dc9188f3..ae3a4fb7 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -619,8 +619,8 @@ func newRPCServer(cfg *Config, s *server, macService *macaroons.Service, cfg, s.cc, cfg.networkDir, macService, atpl, invoiceRegistry, s.htlcSwitch, cfg.ActiveNetParams.Params, s.chanRouter, routerBackend, s.nodeSigner, s.remoteChanDB, s.sweeper, tower, - s.towerClient, cfg.net.ResolveTCPAddr, genInvoiceFeatures, - rpcsLog, + s.towerClient, s.anchorTowerClient, cfg.net.ResolveTCPAddr, + genInvoiceFeatures, rpcsLog, ) if err != nil { return nil, err diff --git a/subrpcserver_config.go b/subrpcserver_config.go index aa1a9ce0..433f7413 100644 --- a/subrpcserver_config.go +++ b/subrpcserver_config.go @@ -96,6 +96,7 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config, sweeper *sweep.UtxoSweeper, tower *watchtower.Standalone, towerClient wtclient.Client, + anchorTowerClient wtclient.Client, tcpResolver lncfg.TCPResolver, genInvoiceFeatures func() *lnwire.FeatureVector, rpcLogger btclog.Logger) error { @@ -243,13 +244,16 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config, case *wtclientrpc.Config: subCfgValue := extractReflectValue(subCfg) - if towerClient != nil { + if towerClient != nil && anchorTowerClient != nil { subCfgValue.FieldByName("Active").Set( reflect.ValueOf(towerClient != nil), ) subCfgValue.FieldByName("Client").Set( reflect.ValueOf(towerClient), ) + subCfgValue.FieldByName("AnchorClient").Set( + reflect.ValueOf(anchorTowerClient), + ) } subCfgValue.FieldByName("Resolver").Set( reflect.ValueOf(tcpResolver),