diff --git a/lnrpc/watchtowerrpc/config_active.go b/lnrpc/watchtowerrpc/config_active.go index 985b49bf..22381626 100644 --- a/lnrpc/watchtowerrpc/config_active.go +++ b/lnrpc/watchtowerrpc/config_active.go @@ -7,6 +7,9 @@ package watchtowerrpc // fields with struct tags are meant to parsed as normal configuration options, // while if able to be populated, the latter fields MUST also be specified. type Config struct { + // Active indicates if the watchtower is enabled. + Active bool + // Tower is the active watchtower which serves as the primary source for // information presented via RPC. Tower WatchtowerBackend diff --git a/lnrpc/watchtowerrpc/handler.go b/lnrpc/watchtowerrpc/handler.go index 4aeaabee..fe44b92d 100644 --- a/lnrpc/watchtowerrpc/handler.go +++ b/lnrpc/watchtowerrpc/handler.go @@ -124,7 +124,7 @@ func (c *Handler) GetInfo(ctx context.Context, // isActive returns nil if the tower backend is initialized, and the Handler can // proccess RPC requests. func (c *Handler) isActive() error { - if c.cfg.Tower != nil { + if c.cfg.Active { return nil } return ErrTowerNotActive diff --git a/subrpcserver_config.go b/subrpcserver_config.go index 600f2d02..dffac0b6 100644 --- a/subrpcserver_config.go +++ b/subrpcserver_config.go @@ -216,6 +216,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl, case *watchtowerrpc.Config: subCfgValue := extractReflectValue(subCfg) + subCfgValue.FieldByName("Active").Set( + reflect.ValueOf(tower != nil), + ) subCfgValue.FieldByName("Tower").Set( reflect.ValueOf(tower), )