diff --git a/loopd/daemon.go b/loopd/daemon.go index 0cd487b..102d393 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -34,8 +34,8 @@ var ( errOnlyStartOnce = fmt.Errorf("daemon can only be started once") ) -// listenerCfg holds closures used to retrieve listeners for the gRPC services. -type listenerCfg struct { +// ListenerCfg holds closures used to retrieve listeners for the gRPC services. +type ListenerCfg struct { // grpcListener returns a TLS listener to use for the gRPC server, based // on the passed TLS configuration. grpcListener func(*tls.Config) (net.Listener, error) @@ -66,7 +66,7 @@ type Daemon struct { ErrChan chan error cfg *Config - listenerCfg *listenerCfg + listenerCfg *ListenerCfg internalErrChan chan error lnd *lndclient.GrpcLndServices @@ -90,7 +90,7 @@ type Daemon struct { } // New creates a new instance of the loop client daemon. -func New(config *Config, lisCfg *listenerCfg) *Daemon { +func New(config *Config, lisCfg *ListenerCfg) *Daemon { return &Daemon{ // We send exactly one error on this channel if something goes // wrong at runtime. Or a nil value if the shutdown was diff --git a/loopd/run.go b/loopd/run.go index ff445fb..724c99e 100644 --- a/loopd/run.go +++ b/loopd/run.go @@ -48,10 +48,10 @@ type RPCConfig struct { LndConn net.Conn } -// newListenerCfg creates and returns a new listenerCfg from the passed config -// and RPCConfig. -func newListenerCfg(config *Config, rpcCfg RPCConfig) *listenerCfg { - return &listenerCfg{ +// NewListenerConfig creates and returns a new listenerCfg from the passed +// config and RPCConfig. +func NewListenerConfig(config *Config, rpcCfg RPCConfig) *ListenerCfg { + return &ListenerCfg{ grpcListener: func(tlsCfg *tls.Config) (net.Listener, error) { // If a custom RPC listener is set, we will listen on // it instead of the regular tcp socket. @@ -218,7 +218,7 @@ func Run(rpcCfg RPCConfig) error { // Print the version before executing either primary directive. log.Infof("Version: %v", loop.Version()) - lisCfg := newListenerCfg(&config, rpcCfg) + lisCfg := NewListenerConfig(&config, rpcCfg) // Execute command. if parser.Active == nil { diff --git a/loopd/view.go b/loopd/view.go index ebd221d..c13c8ba 100644 --- a/loopd/view.go +++ b/loopd/view.go @@ -11,7 +11,7 @@ import ( ) // view prints all swaps currently in the database. -func view(config *Config, lisCfg *listenerCfg) error { +func view(config *Config, lisCfg *ListenerCfg) error { network := lndclient.Network(config.Network) lnd, err := lisCfg.getLnd(network, config.Lnd)