@@ -735,7 +735,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
735735 // there are no pending signed changes, let's directly negotiate a closing transaction
736736 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
737737 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
738- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdownScript, closingFeerate) match {
738+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdownScript, closingFeerate) match {
739739 case Left (f) =>
740740 log.warning(" cannot create local closing txs, waiting for remote closing_complete: {}" , f.getMessage)
741741 goto(NEGOTIATING_SIMPLE ) using DATA_NEGOTIATING_SIMPLE (d.commitments, localShutdown, remoteShutdown, Nil , Nil ) storing() sending sendList
@@ -1331,7 +1331,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
13311331 if (commitments1.hasNoPendingHtlcsOrFeeUpdate) {
13321332 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
13331333 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
1334- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
1334+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
13351335 case Left (f) =>
13361336 log.warning(" cannot create local closing txs, waiting for remote closing_complete: {}" , f.getMessage)
13371337 goto(NEGOTIATING_SIMPLE ) using DATA_NEGOTIATING_SIMPLE (d.commitments, localShutdown, remoteShutdown, Nil , Nil ) storing() sending revocation
@@ -1382,7 +1382,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
13821382 log.debug(" switching to NEGOTIATING spec:\n {}" , commitments1.latest.specs2String)
13831383 if (Features .canUseFeature(d.commitments.params.localParams.initFeatures, d.commitments.params.remoteParams.initFeatures, Features .SimpleClose )) {
13841384 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
1385- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
1385+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, closingFeerate) match {
13861386 case Left (f) =>
13871387 log.warning(" cannot create local closing txs, waiting for remote closing_complete: {}" , f.getMessage)
13881388 goto(NEGOTIATING_SIMPLE ) using DATA_NEGOTIATING_SIMPLE (d.commitments, localShutdown, remoteShutdown, Nil , Nil ) storing()
@@ -1561,7 +1561,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
15611561 if (remoteShutdown.scriptPubKey != d.remoteShutdown.scriptPubKey) {
15621562 // Our peer changed their closing script: we sign a new version of our closing transaction using the new script.
15631563 val feerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
1564- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, feerate) match {
1564+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, remoteShutdown.scriptPubKey, feerate) match {
15651565 case Left (_) => stay() using d.copy(remoteShutdown = remoteShutdown) storing()
15661566 case Right ((closingTxs, closingComplete)) => stay() using d.copy(remoteShutdown = remoteShutdown, proposedClosingTxs = d.proposedClosingTxs :+ closingTxs) storing() sending closingComplete
15671567 }
@@ -1622,7 +1622,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
16221622 if (localShutdown_opt.nonEmpty || c.feerates.nonEmpty) {
16231623 val localScript = localShutdown_opt.map(_.scriptPubKey).getOrElse(d.localShutdown.scriptPubKey)
16241624 val feerate = c.feerates.map(_.preferred).getOrElse(nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates))
1625- MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, localScript, d.remoteShutdown.scriptPubKey, feerate) match {
1625+ MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, localScript, d.remoteShutdown.scriptPubKey, feerate) match {
16261626 case Left (f) => handleCommandError(f, c)
16271627 case Right ((closingTxs, closingComplete)) =>
16281628 log.info(" new closing transaction created with script={} fees={}" , localScript, closingComplete.fees)
@@ -2284,7 +2284,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
22842284 // We retransmit our shutdown: we may have updated our script and they may not have received it.
22852285 // We also sign a new round of closing transactions since network fees may have changed while we were offline.
22862286 val closingFeerate = nodeParams.onChainFeeConf.getClosingFeerate(nodeParams.currentFeerates)
2287- Closing .MutualClose .makeSimpleClosingTx(keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, d.remoteShutdown.scriptPubKey, closingFeerate) match {
2287+ Closing .MutualClose .makeSimpleClosingTx(nodeParams.currentBlockHeight, keyManager, d.commitments.latest, d.localShutdown.scriptPubKey, d.remoteShutdown.scriptPubKey, closingFeerate) match {
22882288 case Left (_) => goto(NEGOTIATING_SIMPLE ) using d sending d.localShutdown
22892289 case Right ((closingTxs, closingComplete)) => goto(NEGOTIATING_SIMPLE ) using d.copy(proposedClosingTxs = d.proposedClosingTxs :+ closingTxs) sending Seq (d.localShutdown, closingComplete)
22902290 }
0 commit comments