commonMain.fr.acinq.lightning.channel.states.Closed.kt Maven / Gradle / Ivy
package fr.acinq.lightning.channel.states
import fr.acinq.lightning.channel.ChannelAction
import fr.acinq.lightning.channel.ChannelCommand
import fr.acinq.lightning.channel.Commitments
/**
* Channel is closed i.t its funding tx has been spent and the spending transactions have been confirmed, it can be forgotten
*/
data class Closed(val state: Closing) : ChannelStateWithCommitments() {
override val commitments: Commitments get() = state.commitments
override fun updateCommitments(input: Commitments): ChannelStateWithCommitments {
return this.copy(state = state.updateCommitments(input) as Closing)
}
override suspend fun ChannelContext.processInternal(cmd: ChannelCommand): Pair> {
return Pair(this@Closed, listOf())
}
}