File tree Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Expand file tree Collapse file tree 3 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -137,21 +137,6 @@ func (f *FSM) WaitForExpirySweepAction(ctx context.Context,
137137 }
138138}
139139
140- // SweptExpiredDepositAction is the final action of the FSM. It signals to the
141- // manager that the deposit has been swept and the FSM can be removed. It also
142- // ends the state machine main loop by cancelling its context.
143- func (f * FSM ) SweptExpiredDepositAction (ctx context.Context ,
144- _ fsm.EventContext ) fsm.EventType {
145-
146- select {
147- case <- ctx .Done ():
148- return fsm .OnError
149-
150- case f .finalizedDepositChan <- f .deposit .OutPoint :
151- return fsm .NoOp
152- }
153- }
154-
155140// FinalizeDepositAction is the final action after a withdrawal. It signals to
156141// the manager that the deposit has been swept and the FSM can be removed.
157142func (f * FSM ) FinalizeDepositAction (ctx context.Context ,
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ func (f *FSM) DepositStatesV0() fsm.States {
292292 Transitions : fsm.Transitions {
293293 OnExpiry : Expired ,
294294 },
295- Action : f .SweptExpiredDepositAction ,
295+ Action : f .FinalizeDepositAction ,
296296 },
297297 Withdrawing : fsm.State {
298298 Transitions : fsm.Transitions {
Original file line number Diff line number Diff line change @@ -473,16 +473,15 @@ func (m *Manager) recoverLoopIns(ctx context.Context) error {
473473 }
474474
475475 // Send the OnRecover event to the state machine.
476- swapHash := loopIn .SwapHash
477- go func () {
478- err = fsm .SendEvent (ctx , OnRecover , nil )
476+ go func (fsm * FSM , swapHash lntypes.Hash ) {
477+ err := fsm .SendEvent (ctx , OnRecover , nil )
479478 if err != nil {
480479 log .Errorf ("Error sending OnStart event: %v" ,
481480 err )
482481 }
483482
484483 m .activeLoopIns [swapHash ] = fsm
485- }()
484+ }(fsm , loopIn . SwapHash )
486485 }
487486
488487 return nil
You can’t perform that action at this time.
0 commit comments