@@ -53,7 +53,7 @@ type ListenerCfg struct {
53
53
// on the passed TLS configuration.
54
54
restListener func (* tls.Config ) (net.Listener , error )
55
55
56
- // getLnd returns a grpc connection to an lnd instance.
56
+ // getLnd returns a grpc connection to a lnd instance.
57
57
getLnd func (lndclient.Network , * lndConfig ) (* lndclient.GrpcLndServices ,
58
58
error )
59
59
}
@@ -120,9 +120,9 @@ func New(config *Config, lisCfg *ListenerCfg) *Daemon {
120
120
// Start starts loopd in daemon mode. It will listen for grpc connections,
121
121
// execute commands and pass back swap status information.
122
122
func (d * Daemon ) Start () error {
123
- // There should be no reason to start the daemon twice. Therefore return
124
- // an error if that's tried. This is mostly to guard against Start and
125
- // StartAsSubserver both being called.
123
+ // There should be no reason to start the daemon twice. Therefore,
124
+ // return an error if that's tried. This is mostly to guard against
125
+ // Start and StartAsSubserver both being called.
126
126
if atomic .AddInt32 (& d .started , 1 ) != 1 {
127
127
return errOnlyStartOnce
128
128
}
@@ -137,7 +137,7 @@ func (d *Daemon) Start() error {
137
137
138
138
// With lnd connected, initialize everything else, such as the swap
139
139
// server client, the swap client RPC server instance and our main swap
140
- // and error handlers. If this fails, then nothing has been started yet
140
+ // and error handlers. If this fails, then nothing has been started yet,
141
141
// and we can just return the error.
142
142
err = d .initialize (true )
143
143
if errors .Is (err , bbolt .ErrTimeout ) {
@@ -324,7 +324,7 @@ func (d *Daemon) startWebServers() error {
324
324
err := d .restServer .Serve (d .restListener )
325
325
// ErrServerClosed is always returned when the proxy is
326
326
// shut down, so don't log it.
327
- if err != nil && err != http .ErrServerClosed {
327
+ if err != nil && ! errors . Is ( err , http .ErrServerClosed ) {
328
328
// Notify the main error handler goroutine that
329
329
// we exited unexpectedly here. We don't have to
330
330
// worry about blocking as the internal error
@@ -343,7 +343,7 @@ func (d *Daemon) startWebServers() error {
343
343
344
344
log .Infof ("RPC server listening on %s" , d .grpcListener .Addr ())
345
345
err = d .grpcServer .Serve (d .grpcListener )
346
- if err != nil && err != grpc .ErrServerStopped {
346
+ if err != nil && ! errors . Is ( err , grpc .ErrServerStopped ) {
347
347
// Notify the main error handler goroutine that
348
348
// we exited unexpectedly here. We don't have to
349
349
// worry about blocking as the internal error
@@ -719,9 +719,9 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
719
719
var runtimeErr error
720
720
721
721
// There are only two ways this goroutine can exit. Either there
722
- // is an internal error or the caller requests shutdown. In both
723
- // cases we wait for the stop to complete before we signal the
724
- // caller that we're done.
722
+ // is an internal error or the caller requests a shutdown.
723
+ // In both cases we wait for the stop to complete before we
724
+ // signal the caller that we're done.
725
725
select {
726
726
case runtimeErr = <- d .internalErrChan :
727
727
log .Errorf ("Runtime error in daemon, shutting down: " +
@@ -730,7 +730,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
730
730
case <- d .quit :
731
731
}
732
732
733
- // We need to shutdown before sending the error on the channel,
733
+ // We need to shut down before sending the error on the channel,
734
734
// otherwise a caller might exit the process too early.
735
735
d .stop ()
736
736
cleanupMacaroonStore ()
@@ -761,7 +761,7 @@ func (d *Daemon) stop() {
761
761
d .mainCtxCancel ()
762
762
}
763
763
764
- // As there is no swap activity anymore, we can forcefully shutdown the
764
+ // As there is no swap activity anymore, we can forcefully shut down the
765
765
// gRPC and HTTP servers now.
766
766
log .Infof ("Stopping gRPC server" )
767
767
if d .grpcServer != nil {
0 commit comments