staticaddr: log deposit state transition only if executed

This commit is contained in:
Slyghtning 2025-03-21 14:46:16 +01:00
parent 82e34a6d5e
commit ff44b3b640
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -378,11 +378,6 @@ func (f *FSM) updateDeposit(ctx context.Context,
return
}
f.Debugf("NextState: %v, PreviousState: %v, Event: %v",
notification.NextState, notification.PreviousState,
notification.Event,
)
type checkStateFunc func(state fsm.StateType) bool
type setStateFunc func(state fsm.StateType)
checkFunc := checkStateFunc(f.deposit.IsInState)
@ -397,6 +392,11 @@ func (f *FSM) updateDeposit(ctx context.Context,
return
}
f.Debugf("NextState: %v, PreviousState: %v, Event: %v",
notification.NextState, notification.PreviousState,
notification.Event,
)
err := f.cfg.Store.UpdateDeposit(ctx, f.deposit)
if err != nil {
f.Errorf("unable to update deposit: %w", err)