You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We introduce a new `NEGOTIATING_SIMPLE` state where we exchange the
`closing_complete` and `closing_sig` messages, and allow RBF-ing previous
transactions and updating our closing script.
We stay in that state until one of the transactions confirms, or a force
close is detected. This is important to ensure we're able to correctly
reconnect and negotiate RBF candidates.
We keep this separate from the previous `NEGOTIATING` state to make it
easier to remove support for the older mutual close protocols once we're
confident the network has been upgraded.
Copy file name to clipboardExpand all lines: eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelData.scala
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ case object WAIT_FOR_DUAL_FUNDING_READY extends ChannelState
72
72
caseobjectNORMALextendsChannelState
73
73
caseobjectSHUTDOWNextendsChannelState
74
74
caseobjectNEGOTIATINGextendsChannelState
75
+
caseobjectNEGOTIATING_SIMPLEextendsChannelState
75
76
caseobjectCLOSINGextendsChannelState
76
77
caseobjectCLOSEDextendsChannelState
77
78
caseobjectOFFLINEextendsChannelState
@@ -653,6 +654,16 @@ final case class DATA_NEGOTIATING(commitments: Commitments,
653
654
require(closingTxProposed.nonEmpty, "there must always be a list for the current negotiation")
654
655
require(!commitments.params.localParams.paysClosingFees || closingTxProposed.forall(_.nonEmpty), "initiator must have at least one closing signature for every negotiation attempt because it initiates the closing")
caseclassCannotGenerateClosingTx (overridevalchannelId:ByteVector32) extendsChannelException(channelId, "failed to generate closing transaction: all outputs are trimmed")
120
+
caseclassMissingCloseSignature (overridevalchannelId:ByteVector32) extendsChannelException(channelId, "closing_complete is missing a signature for a closing transaction including our output")
119
121
caseclassInvalidCloseSignature (overridevalchannelId:ByteVector32, txId: TxId) extendsChannelException(channelId, s"invalid close signature: txId=$txId")
122
+
caseclassInvalidCloseeScript (overridevalchannelId:ByteVector32, received: ByteVector, expected: ByteVector) extendsChannelException(channelId, s"invalid closee script used in closing_complete: our latest script is $expected, you're using $received")
120
123
caseclassInvalidCloseAmountBelowDust (overridevalchannelId:ByteVector32, txId: TxId) extendsChannelException(channelId, s"invalid closing tx: some outputs are below dust: txId=$txId")
// If our output isn't dust, they must provide a signature for a transaction that includes it.
751
+
// Note that we're the closee, so we look for signatures including the closee output.
752
+
(closingTxs.localAndRemote_opt, closingTxs.localOnly_opt) match {
753
+
case (Some(_), Some(_)) if closingComplete.closerAndCloseeOutputsSig_opt.isEmpty && closingComplete.closeeOutputOnlySig_opt.isEmpty =>returnLeft(MissingCloseSignature(commitment.channelId))
754
+
case (Some(_), None) if closingComplete.closerAndCloseeOutputsSig_opt.isEmpty =>returnLeft(MissingCloseSignature(commitment.channelId))
755
+
case (None, Some(_)) if closingComplete.closeeOutputOnlySig_opt.isEmpty =>returnLeft(MissingCloseSignature(commitment.channelId))
756
+
case _ => ()
757
+
}
758
+
// We choose the closing signature that matches our preferred closing transaction.
0 commit comments