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