@@ -751,7 +751,8 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
751751 if (d.commitments.hasNoPendingHtlcsOrFeeUpdate) {
752752 // there are no pending signed changes, let's directly negotiate a closing transaction
753753 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
754- startSimpleClose(d.commitments, localShutdown, remoteShutdown, d.closingFeerates, sendList)
754+ val (d1, closingComplete_opt) = startSimpleClose(d.commitments, localShutdown, remoteShutdown, d.closingFeerates)
755+ goto(NEGOTIATING_SIMPLE ) using d1 storing() sending sendList ++ closingComplete_opt.toSeq
755756 } else if (d.commitments.params.localParams.paysClosingFees) {
756757 // we pay the closing fees, so we initiate the negotiation by sending the first closing_signed
757758 val (closingTx, closingSigned) = MutualClose .makeFirstClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdownScript, nodeParams.currentFeeratesForFundingClosing, nodeParams.onChainFeeConf, d.closingFeerates)
@@ -1535,7 +1536,8 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
15351536 context.system.eventStream.publish(ChannelSignatureReceived (self, commitments1))
15361537 if (commitments1.hasNoPendingHtlcsOrFeeUpdate) {
15371538 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
1538- startSimpleClose(d.commitments, localShutdown, remoteShutdown, d.closingFeerates, revocation :: Nil )
1539+ val (d1, closingComplete_opt) = startSimpleClose(d.commitments, localShutdown, remoteShutdown, d.closingFeerates)
1540+ goto(NEGOTIATING_SIMPLE ) using d1 storing() sending revocation +: closingComplete_opt.toSeq
15391541 } else if (d.commitments.params.localParams.paysClosingFees) {
15401542 // we pay the closing fees, so we initiate the negotiation by sending the first closing_signed
15411543 val (closingTx, closingSigned) = MutualClose .makeFirstClosingTx(keyManager, commitments1.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, nodeParams.currentFeeratesForFundingClosing, nodeParams.onChainFeeConf, closingFeerates)
@@ -1579,7 +1581,8 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
15791581 if (commitments1.hasNoPendingHtlcsOrFeeUpdate) {
15801582 log.debug(" switching to NEGOTIATING spec:\n {}" , commitments1.latest.specs2String)
15811583 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
1582- startSimpleClose(d.commitments, localShutdown, remoteShutdown, d.closingFeerates, Nil )
1584+ val (d1, closingComplete_opt) = startSimpleClose(d.commitments, localShutdown, remoteShutdown, d.closingFeerates)
1585+ goto(NEGOTIATING_SIMPLE ) using d1 storing() sending closingComplete_opt.toSeq
15831586 } else if (d.commitments.params.localParams.paysClosingFees) {
15841587 // we pay the closing fees, so we initiate the negotiation by sending the first closing_signed
15851588 val (closingTx, closingSigned) = MutualClose .makeFirstClosingTx(keyManager, commitments1.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, nodeParams.currentFeeratesForFundingClosing, nodeParams.onChainFeeConf, closingFeerates)
0 commit comments