From 12ca54bc9057bdc73afacce3e4711dc72d559917 Mon Sep 17 00:00:00 2001 From: Anton Kumaigorodski Date: Wed, 19 Apr 2017 17:50:01 +0300 Subject: [PATCH] both `localCommit` & `remoteCommit` htlcs are now checked on Shutdown (#73) --- .../src/main/scala/fr/acinq/eclair/channel/Channel.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclair-node/src/main/scala/fr/acinq/eclair/channel/Channel.scala b/eclair-node/src/main/scala/fr/acinq/eclair/channel/Channel.scala index f4d777820..13ca1ef9c 100644 --- a/eclair-node/src/main/scala/fr/acinq/eclair/channel/Channel.scala +++ b/eclair-node/src/main/scala/fr/acinq/eclair/channel/Channel.scala @@ -582,7 +582,7 @@ class Channel(val nodeParams: NodeParams, remoteNodeId: PublicKey, blockchain: A (shutdown, commitments2.copy(unackedMessages = commitments2.unackedMessages :+ shutdown)) }) match { case Success((localShutdown, commitments3)) - if (commitments3.remoteNextCommitInfo.isRight && commitments3.localCommit.spec.htlcs.size == 0 && commitments3.localCommit.spec.htlcs.size == 0) + if (commitments3.remoteNextCommitInfo.isRight && commitments3.localCommit.spec.htlcs.size == 0 && commitments3.remoteCommit.spec.htlcs.size == 0) || (commitments3.remoteNextCommitInfo.isLeft && commitments3.localCommit.spec.htlcs.size == 0 && commitments3.remoteNextCommitInfo.left.get.nextRemoteCommit.spec.htlcs.size == 0) => val closingSigned = Closing.makeFirstClosingTx(commitments3, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey) goto(NEGOTIATING) using DATA_NEGOTIATING(commitments3.copy(unackedMessages = commitments3.unackedMessages :+ closingSigned), localShutdown, remoteShutdown, closingSigned)