Skip to content

Commit

Permalink
htlcswitch: fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
starius committed Nov 28, 2024
1 parent 367a90c commit 00eb02e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion htlcswitch/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,7 @@ out:
func (s *Switch) Start() error {
if !atomic.CompareAndSwapInt32(&s.started, 0, 1) {
log.Warn("Htlc Switch already started")

return errors.New("htlc switch already started")
}

Expand All @@ -1779,19 +1780,23 @@ func (s *Switch) Start() error {
err = fmt.Errorf("unable to start htlc forwarder: %w",
ErrSwitchExiting)
log.Errorf("%v", err)

return err
}

if err := s.reforwardResponses(); err != nil {
s.Stop()
// We are already stopping so we can ignore the error.
_ = s.Stop()
log.Errorf("unable to reforward responses: %v", err)

return err
}

if err := s.reforwardResolutions(); err != nil {
// We are already stopping so we can ignore the error.
_ = s.Stop()
log.Errorf("unable to reforward resolutions: %v", err)

return err
}

Expand Down

0 comments on commit 00eb02e

Please sign in to comment.