deposit: add OnExpiry self-transitions to OpeningChannel and ChannelPublished

Both OpeningChannel and ChannelPublished lacked OnExpiry transitions.
handleBlockNotification fires OnExpiry on every new block once the
deposit is expired, regardless of the current state. Since both states
use NoOpAction or FinalizeDepositAction which release the FSM mutex
briefly, an OnExpiry SendEvent can sneak in. Add self-transitions so
the event is safely absorbed.
This commit is contained in:
Slyghtning 2026-02-19 09:53:55 +01:00
parent 52d884cec1
commit dbac12ed78
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -392,10 +392,22 @@ func (f *FSM) DepositStatesV0() fsm.States {
fsm.OnError: Deposited,
OnChannelPublished: ChannelPublished,
OnRecover: OpeningChannel,
// OnExpiry can arrive on every block once
// the deposit is expired. Since the channel
// open is still in progress we absorb the
// event as a self-transition.
OnExpiry: OpeningChannel,
},
Action: fsm.NoOpAction,
},
ChannelPublished: fsm.State{
Transitions: fsm.Transitions{
// OnExpiry can arrive on every block once
// the deposit is expired. Since the channel
// is already published we absorb the event
// as a self-transition.
OnExpiry: ChannelPublished,
},
Action: f.FinalizeDepositAction,
},
}