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
Fixup: simplify nonce handling in InteractiveTxBuilder and improve error handling
In the interactive session there can can be only one optional shared input, and we know its type in advance and generate a local nonce for it.
We add specific channel exceptions for invalid/missing nonce which makes error handling safer (they are matched in our error handler).
Copy file name to clipboardExpand all lines: eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelExceptions.scala
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -150,5 +150,9 @@ case class CommandUnavailableInThisState (override val channelId: Byte
150
150
caseclassForbiddenDuringSplice (overridevalchannelId:ByteVector32, command: String) extendsChannelException(channelId, s"cannot process $command while splicing")
151
151
caseclassForbiddenDuringQuiescence (overridevalchannelId:ByteVector32, command: String) extendsChannelException(channelId, s"cannot process $command while quiescent")
caseclassMissingNextLocalNonce (overridevalchannelId:ByteVector32) extendsChannelException(channelId, "next local nonce tlv is missing")
153
+
caseclassMissingNonce (overridevalchannelId:ByteVector32, fundingTxId: TxId) extendsChannelException(channelId, s"next nonce for funding tx $fundingTxId is missing")
154
+
caseclassInvalidNonce (overridevalchannelId:ByteVector32, fundingTxId: TxId) extendsChannelException(channelId, s"next nonce for funding tx $fundingTxId is not valid")
if (reserveToFundingRatio > nodeParams.channelConf.maxReserveToFundingRatio) returnLeft(ChannelReserveTooHigh(open.temporaryChannelId, open.channelReserveSatoshis, reserveToFundingRatio, nodeParams.channelConf.maxReserveToFundingRatio))
147
147
148
-
if (channelType.commitmentFormat.isInstanceOf[SimpleTaprootChannelCommitmentFormat] && open.nexLocalNonce_opt.isEmpty) returnLeft(MissingNextLocalNonce(open.temporaryChannelId))
148
+
if (channelType.commitmentFormat.isInstanceOf[SimpleTaprootChannelCommitmentFormat] && open.nexLocalNonce_opt.isEmpty) returnLeft(MissingNonce(open.temporaryChannelId, TxId(ByteVector32.Zeroes)))
if (channelType.commitmentFormat.isInstanceOf[SimpleTaprootChannelCommitmentFormat] && accept.nexLocalNonce_opt.isEmpty) returnLeft(MissingNextLocalNonce(open.temporaryChannelId))
246
+
if (channelType.commitmentFormat.isInstanceOf[SimpleTaprootChannelCommitmentFormat] && accept.nexLocalNonce_opt.isEmpty) returnLeft(MissingNonce(open.temporaryChannelId, TxId(ByteVector32.Zeroes)))
0 commit comments