1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-12 19:01:39 +01:00

Workaround for DATA_CLOSING for custom commit published

This commit is contained in:
Dominique Padiou 2024-11-21 15:18:49 +01:00
parent 0b04706de0
commit 30ea80c560
No known key found for this signature in database
GPG key ID: 574C8C6A1673E987
2 changed files with 2 additions and 2 deletions

View file

@ -216,7 +216,8 @@ final case class DATA_CLOSING(commitments: Commitments,
futureRemoteCommitPublished: Option[RemoteCommitPublished] = None,
revokedCommitPublished: List[RevokedCommitPublished] = Nil) extends Data with HasCommitments {
val spendingTxes = mutualClosePublished ::: localCommitPublished.map(_.commitTx).toList ::: remoteCommitPublished.map(_.commitTx).toList ::: nextRemoteCommitPublished.map(_.commitTx).toList ::: customRemoteCommitPublished.values.map(_.commitTx).toList ::: futureRemoteCommitPublished.map(_.commitTx).toList ::: revokedCommitPublished.map(_.commitTx)
require(spendingTxes.nonEmpty, "there must be at least one tx published in this state")
// workaround because custom commits published are not persisted
// require(spendingTxes.nonEmpty, "there must be at least one tx published in this state")
}
final case class DATA_WAIT_FOR_REMOTE_PUBLISH_FUTURE_COMMITMENT(commitments: Commitments, remoteChannelReestablish: ChannelReestablish) extends Data with HasCommitments

View file

@ -99,7 +99,6 @@ class SqliteChannelsDb(sqlite: Connection) extends ChannelsDb with Logging {
using(sqlite.createStatement) { statement =>
val rs = statement.executeQuery("SELECT data FROM local_channels WHERE is_closed=0")
codecSequence(rs, stateDataCodec, onError = { message =>
logger.error(s"cannot read local channels data: data=${BitVector(rs.getBytes("data")).toHex}")
logger.error(message)
})
}