Skip to content

Commit e145963

Browse files
authored
Merge pull request #956 from hieblmi/minor-static-fixes
staticaddr: minor fixes
2 parents f7769d2 + d526192 commit e145963

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

staticaddr/deposit/actions.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff 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.
157142
func (f *FSM) FinalizeDepositAction(ctx context.Context,

staticaddr/deposit/fsm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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{

staticaddr/loopin/manager.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)