mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Merge pull request #956 from hieblmi/minor-static-fixes
staticaddr: minor fixes
This commit is contained in:
commit
e145963f2e
3 changed files with 4 additions and 20 deletions
|
|
@ -137,21 +137,6 @@ func (f *FSM) WaitForExpirySweepAction(ctx context.Context,
|
|||
}
|
||||
}
|
||||
|
||||
// SweptExpiredDepositAction is the final action of the FSM. It signals to the
|
||||
// manager that the deposit has been swept and the FSM can be removed. It also
|
||||
// ends the state machine main loop by cancelling its context.
|
||||
func (f *FSM) SweptExpiredDepositAction(ctx context.Context,
|
||||
_ fsm.EventContext) fsm.EventType {
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return fsm.OnError
|
||||
|
||||
case f.finalizedDepositChan <- f.deposit.OutPoint:
|
||||
return fsm.NoOp
|
||||
}
|
||||
}
|
||||
|
||||
// FinalizeDepositAction is the final action after a withdrawal. It signals to
|
||||
// the manager that the deposit has been swept and the FSM can be removed.
|
||||
func (f *FSM) FinalizeDepositAction(ctx context.Context,
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ func (f *FSM) DepositStatesV0() fsm.States {
|
|||
Transitions: fsm.Transitions{
|
||||
OnExpiry: Expired,
|
||||
},
|
||||
Action: f.SweptExpiredDepositAction,
|
||||
Action: f.FinalizeDepositAction,
|
||||
},
|
||||
Withdrawing: fsm.State{
|
||||
Transitions: fsm.Transitions{
|
||||
|
|
|
|||
|
|
@ -473,16 +473,15 @@ func (m *Manager) recoverLoopIns(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// Send the OnRecover event to the state machine.
|
||||
swapHash := loopIn.SwapHash
|
||||
go func() {
|
||||
err = fsm.SendEvent(ctx, OnRecover, nil)
|
||||
go func(fsm *FSM, swapHash lntypes.Hash) {
|
||||
err := fsm.SendEvent(ctx, OnRecover, nil)
|
||||
if err != nil {
|
||||
log.Errorf("Error sending OnStart event: %v",
|
||||
err)
|
||||
}
|
||||
|
||||
m.activeLoopIns[swapHash] = fsm
|
||||
}()
|
||||
}(fsm, loopIn.SwapHash)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue