lnwallet/chancloser: ignore spurious channel flushed events
If we go to close while the channel is already flushed, we might get an extra event, so we can safely ignore it and do a self state transition.
This commit is contained in:
1 parent
27b24ab86a
commit
835d7623d4
1 file changed
+6
@@ -582,6 +582,12 @@ func (c *ClosingNegotiation) ProcessEvent(event ProtocolEvent, env *Environment,
|
||||
// we receive a confirmation event, or we receive a signal to restart
|
||||
// the co-op close process.
|
||||
switch msg := event.(type) {
|
||||
// Ignore any potential duplicate channel flushed events.
|
||||
case *ChannelFlushed:
|
||||
return &CloseStateTransition{
|
||||
NextState: c,
|
||||
}, nil
|
||||
|
||||
// If we get a confirmation, then the spend request we issued when we
|
||||
// were leaving the ChannelFlushing state has been confirmed. We'll
|
||||
// now transition to the StateFin state.
|
||||
|
||||
Reference in new issue
Block a user