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,
137
137
}
138
138
}
139
139
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
-
155
140
// FinalizeDepositAction is the final action after a withdrawal. It signals to
156
141
// the manager that the deposit has been swept and the FSM can be removed.
157
142
func (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 {
292
292
Transitions : fsm.Transitions {
293
293
OnExpiry : Expired ,
294
294
},
295
- Action : f .SweptExpiredDepositAction ,
295
+ Action : f .FinalizeDepositAction ,
296
296
},
297
297
Withdrawing : fsm.State {
298
298
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 {
473
473
}
474
474
475
475
// 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 )
479
478
if err != nil {
480
479
log .Errorf ("Error sending OnStart event: %v" ,
481
480
err )
482
481
}
483
482
484
483
m .activeLoopIns [swapHash ] = fsm
485
- }()
484
+ }(fsm , loopIn . SwapHash )
486
485
}
487
486
488
487
return nil
You can’t perform that action at this time.
0 commit comments