@@ -734,7 +734,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
734734 // there are no pending signed changes, let's directly negotiate a closing transaction
735735 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
736736 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
737- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdownScript, closingFeerate) match {
737+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdownScript, closingFeerate) match {
738738 case Left (f) =>
739739 log.warning(" cannot create local closing txs, waiting for remote closing_complete: {}" , f.getMessage)
740740 goto(NEGOTIATING_SIMPLE ) using DATA_NEGOTIATING_SIMPLE (d.commitments, localShutdown, remoteShutdown, Nil , Nil ) storing() sending sendList
@@ -1330,7 +1330,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
13301330 if (commitments1.hasNoPendingHtlcsOrFeeUpdate) {
13311331 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
13321332 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
1333- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
1333+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
13341334 case Left (f) =>
13351335 log.warning(" cannot create local closing txs, waiting for remote closing_complete: {}" , f.getMessage)
13361336 goto(NEGOTIATING_SIMPLE ) using DATA_NEGOTIATING_SIMPLE (d.commitments, localShutdown, remoteShutdown, Nil , Nil ) storing() sending revocation
@@ -1381,7 +1381,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
13811381 log.debug(" switching to NEGOTIATING spec:\n {}" , commitments1.latest.specs2String)
13821382 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
13831383 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
1384- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
1384+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
13851385 case Left (f) =>
13861386 log.warning(" cannot create local closing txs, waiting for remote closing_complete: {}" , f.getMessage)
13871387 goto(NEGOTIATING_SIMPLE ) using DATA_NEGOTIATING_SIMPLE (d.commitments, localShutdown, remoteShutdown, Nil , Nil ) storing()
@@ -1560,7 +1560,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
15601560 if (remoteShutdown.scriptPubKey != d.remoteShutdown.scriptPubKey) {
15611561 // Our peer changed their closing script: we sign a new version of our closing transaction using the new script.
15621562 val feerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
1563- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, feerate) match {
1563+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, feerate) match {
15641564 case Left (_) => stay() using d.copy(remoteShutdown = remoteShutdown) storing()
15651565 case Right ((closingTxs, closingComplete)) => stay() using d.copy(remoteShutdown = remoteShutdown, proposedClosingTxs = d.proposedClosingTxs :+ closingTxs) storing() sending closingComplete
15661566 }
@@ -1621,7 +1621,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
16211621 if (localShutdown_opt.nonEmpty || c.feerates.nonEmpty) {
16221622 val localScript = localShutdown_opt.map(_.scriptPubKey).getOrElse(d.localShutdown.scriptPubKey)
16231623 val feerate = c.feerates.map(_.preferred).getOrElse(nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates))
1624- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localScript, d.remoteShutdown.scriptPubKey, feerate) match {
1624+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localScript, d.remoteShutdown.scriptPubKey, feerate) match {
16251625 case Left (f) => handleCommandError(f, c)
16261626 case Right ((closingTxs, closingComplete)) =>
16271627 log.info(" new closing transaction created with script={} fees={}" , localScript, closingComplete.fees)
@@ -2241,7 +2241,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
22412241 // We retransmit our shutdown: we may have updated our script and they may not have received it.
22422242 // We also sign a new round of closing transactions since network fees may have changed while we were offline.
22432243 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
2244- Closing .MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, d.remoteShutdown.scriptPubKey, closingFeerate) match {
2244+ Closing .MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, d.remoteShutdown.scriptPubKey, closingFeerate) match {
22452245 case Left (_) => goto(NEGOTIATING_SIMPLE ) using d sending d.localShutdown
22462246 case Right ((closingTxs, closingComplete)) => goto(NEGOTIATING_SIMPLE ) using d.copy(proposedClosingTxs = d.proposedClosingTxs :+ closingTxs) sending Seq (d.localShutdown, closingComplete)
22472247 }
0 commit comments