Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions channels/channels_fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,16 @@ func cleanupConnection(ctx fsm.Context, env ChannelEnvironment, channel internal
if otherParty == env.ID() {
otherParty = channel.Responder
}
env.CleanupChannel(datatransfer.ChannelID{ID: channel.TransferID, Initiator: channel.Initiator, Responder: channel.Responder})
env.Unprotect(otherParty, datatransfer.ChannelID{ID: channel.TransferID, Initiator: channel.Initiator, Responder: channel.Responder}.String())
return ctx.Trigger(datatransfer.CleanupComplete)


// the state machine event loop will block on these calls if we don't spin up a go-routine here.
go func() {
env.CleanupChannel(datatransfer.ChannelID{ID: channel.TransferID, Initiator: channel.Initiator, Responder: channel.Responder})
env.Unprotect(otherParty, datatransfer.ChannelID{ID: channel.TransferID, Initiator: channel.Initiator, Responder: channel.Responder}.String())
_ = ctx.Trigger(datatransfer.CleanupComplete)
}()

return nil
}

// CleanupStates are the penultimate states for a channel
Expand Down