Skip to content

Commit c75326f

Browse files
committed
Remove InputInfo.redeemInfo
1 parent 32c0262 commit c75326f

31 files changed

+180
-183
lines changed

eclair-core/src/main/scala/fr/acinq/eclair/SpendFromChannelAddress.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package fr.acinq.eclair
33
import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey
44
import fr.acinq.bitcoin.scalacompat.{ByteVector64, DeterministicWallet, OutPoint, Satoshi, SatoshiLong, Script, ScriptWitness, Transaction, TxIn, TxOut, addressToPublicKeyScript}
55
import fr.acinq.eclair.blockchain.fee.FeeratePerKw
6-
import fr.acinq.eclair.channel.ChannelConfig
6+
import fr.acinq.eclair.channel.{ChannelConfig, Helpers}
77
import fr.acinq.eclair.transactions.Scripts.multiSig2of2
88
import fr.acinq.eclair.transactions.Transactions._
99
import fr.acinq.eclair.transactions.{Scripts, Transactions}
@@ -45,10 +45,10 @@ trait SpendFromChannelAddress {
4545
inputTx <- appKit.wallet.getTransaction(outPoint.txid)
4646
channelKeys = appKit.nodeParams.channelKeyManager.channelKeys(ChannelConfig.standard, fundingKeyPath)
4747
localFundingKey = channelKeys.fundingKey(fundingTxIndex)
48-
fundingRedeemScript = multiSig2of2(localFundingKey.publicKey, remoteFundingPubkey)
49-
inputInfo = InputInfo(outPoint, inputTx.txOut(outPoint.index.toInt), fundingRedeemScript)
48+
redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey.publicKey, remoteFundingPubkey, DefaultCommitmentFormat)
49+
inputInfo = InputInfo(outPoint, inputTx.txOut(outPoint.index.toInt))
5050
// classify as splice, doesn't really matter
51-
localSig = Transactions.SpliceTx(inputInfo, unsignedTx).sign(localFundingKey, TxOwner.Local, DefaultCommitmentFormat, Map.empty)
51+
localSig = Transactions.SpliceTx(inputInfo, unsignedTx).sign(localFundingKey, redeemInfo, TxOwner.Local, DefaultCommitmentFormat, Map.empty)
5252
witness = Scripts.witness2of2(localSig, remoteSig, localFundingKey.publicKey, remoteFundingPubkey)
5353
signedTx = unsignedTx.updateWitness(0, witness)
5454
} yield SpendFromChannelResult(signedTx)

eclair-core/src/main/scala/fr/acinq/eclair/channel/Commitments.scala

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,17 @@ object LocalCommit {
194194
def fromCommitSig(params: ChannelParams, commitKeys: LocalCommitmentKeys, fundingTxId: TxId,
195195
fundingKey: PrivateKey, remoteFundingPubKey: PublicKey, commitInput: InputInfo,
196196
commit: CommitSig, localCommitIndex: Long, spec: CommitmentSpec): Either[ChannelException, LocalCommit] = {
197-
val (localCommitTx, htlcTxs) = Commitment.makeLocalTxs(params, commitKeys, localCommitIndex, fundingKey, remoteFundingPubKey, commitInput, spec)
198-
if (!localCommitTx.checkSig(commit.signature, remoteFundingPubKey, TxOwner.Remote, params.commitmentFormat)) {
197+
val ((localCommitTx, redeemInfo), htlcTxs) = Commitment.makeLocalTxs(params, commitKeys, localCommitIndex, fundingKey, remoteFundingPubKey, commitInput, spec)
198+
if (!localCommitTx.checkSig(commit.signature, redeemInfo, remoteFundingPubKey, TxOwner.Remote, params.commitmentFormat)) {
199199
return Left(InvalidCommitmentSignature(params.channelId, fundingTxId, localCommitIndex, localCommitTx.tx))
200200
}
201-
val sortedHtlcTxs = htlcTxs.sortBy(_.input.outPoint.index)
201+
val sortedHtlcTxs = htlcTxs.sortBy(_._1.input.outPoint.index)
202202
if (commit.htlcSignatures.size != sortedHtlcTxs.size) {
203203
return Left(HtlcSigCountMismatch(params.channelId, sortedHtlcTxs.size, commit.htlcSignatures.size))
204204
}
205205
val htlcTxsAndRemoteSigs = sortedHtlcTxs.zip(commit.htlcSignatures).toList.map {
206-
case (htlcTx: HtlcTx, remoteSig) =>
207-
if (!htlcTx.checkSig(remoteSig, commitKeys.theirHtlcPublicKey, TxOwner.Remote, params.commitmentFormat)) {
206+
case ((htlcTx: HtlcTx, redeemInfo: RedeemInfo), remoteSig) =>
207+
if (!htlcTx.checkSig(remoteSig, redeemInfo, commitKeys.theirHtlcPublicKey, TxOwner.Remote, params.commitmentFormat)) {
208208
return Left(InvalidHtlcSignature(params.channelId, htlcTx.tx.txid))
209209
}
210210
HtlcTxAndRemoteSig(htlcTx, remoteSig)
@@ -218,10 +218,10 @@ case class RemoteCommit(index: Long, spec: CommitmentSpec, txid: TxId, remotePer
218218
def sign(params: ChannelParams, channelKeys: ChannelKeys, fundingTxIndex: Long, remoteFundingPubKey: PublicKey, commitInput: InputInfo): CommitSig = {
219219
val fundingKey = channelKeys.fundingKey(fundingTxIndex)
220220
val commitKeys = RemoteCommitmentKeys(params, channelKeys, remotePerCommitmentPoint)
221-
val (remoteCommitTx, htlcTxs) = Commitment.makeRemoteTxs(params, commitKeys, index, fundingKey, remoteFundingPubKey, commitInput, spec)
222-
val sig = remoteCommitTx.sign(fundingKey, TxOwner.Remote, params.commitmentFormat, Map.empty)
223-
val sortedHtlcTxs = htlcTxs.sortBy(_.input.outPoint.index)
224-
val htlcSigs = sortedHtlcTxs.map(_.sign(commitKeys.ourHtlcKey, TxOwner.Remote, params.commitmentFormat, Map.empty))
221+
val ((remoteCommitTx, redeemInfo), htlcTxs) = Commitment.makeRemoteTxs(params, commitKeys, index, fundingKey, remoteFundingPubKey, commitInput, spec)
222+
val sig = remoteCommitTx.sign(fundingKey, redeemInfo, TxOwner.Remote, params.commitmentFormat, Map.empty)
223+
val sortedHtlcTxs = htlcTxs.sortBy(_._1.input.outPoint.index)
224+
val htlcSigs = sortedHtlcTxs.map{ case (tx, redeemInfo) => tx.sign(commitKeys.ourHtlcKey, redeemInfo, TxOwner.Remote, params.commitmentFormat, Map.empty) }
225225
CommitSig(params.channelId, sig, htlcSigs.toList)
226226
}
227227
}
@@ -625,11 +625,11 @@ case class Commitment(fundingTxIndex: Long,
625625
// remote commitment will include all local proposed changes + remote acked changes
626626
val spec = CommitmentSpec.reduce(remoteCommit.spec, changes.remoteChanges.acked, changes.localChanges.proposed)
627627
val fundingKey = channelKeys.fundingKey(fundingTxIndex)
628-
val (remoteCommitTx, htlcTxs) = Commitment.makeRemoteTxs(params, commitKeys, remoteCommit.index + 1, fundingKey, remoteFundingPubKey, commitInput, spec)
629-
val sig = remoteCommitTx.sign(fundingKey, TxOwner.Remote, params.commitmentFormat, Map.empty)
628+
val ((remoteCommitTx, redeemInfo), htlcTxs) = Commitment.makeRemoteTxs(params, commitKeys, remoteCommit.index + 1, fundingKey, remoteFundingPubKey, commitInput, spec)
629+
val sig = remoteCommitTx.sign(fundingKey, redeemInfo, TxOwner.Remote, params.commitmentFormat, Map.empty)
630630

631-
val sortedHtlcTxs: Seq[TransactionWithInputInfo] = htlcTxs.sortBy(_.input.outPoint.index)
632-
val htlcSigs = sortedHtlcTxs.map(_.sign(commitKeys.ourHtlcKey, TxOwner.Remote, params.commitmentFormat, Map.empty))
631+
val sortedHtlcTxs = htlcTxs.sortBy(_._1.input.outPoint.index)
632+
val htlcSigs = sortedHtlcTxs.map { case (tx, redeemInfo) => tx.sign(commitKeys.ourHtlcKey, redeemInfo, TxOwner.Remote, params.commitmentFormat, Map.empty) }
633633

634634
// NB: IN/OUT htlcs are inverted because this is the remote commit
635635
log.info(s"built remote commit number=${remoteCommit.index + 1} toLocalMsat=${spec.toLocal.toLong} toRemoteMsat=${spec.toRemote.toLong} htlc_in={} htlc_out={} feeratePerKw=${spec.commitTxFeerate} txid=${remoteCommitTx.tx.txid} fundingTxId=$fundingTxId", spec.htlcs.collect(DirectedHtlc.outgoing).map(_.id).mkString(","), spec.htlcs.collect(DirectedHtlc.incoming).map(_.id).mkString(","))
@@ -664,7 +664,8 @@ case class Commitment(fundingTxIndex: Long,
664664
def fullySignedLocalCommitTx(params: ChannelParams, channelKeys: ChannelKeys): CommitTx = {
665665
val unsignedCommitTx = localCommit.commitTxAndRemoteSig.commitTx
666666
val fundingKey = channelKeys.fundingKey(fundingTxIndex)
667-
val localSig = unsignedCommitTx.sign(fundingKey, TxOwner.Local, params.commitmentFormat, Map.empty)
667+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(fundingKey.publicKey, remoteFundingPubKey, params.commitmentFormat)
668+
val localSig = unsignedCommitTx.sign(fundingKey, redeemInfo, TxOwner.Local, params.commitmentFormat, Map.empty)
668669
val RemoteSignature.FullSignature(remoteSig) = localCommit.commitTxAndRemoteSig.remoteSig
669670
val commitTx = unsignedCommitTx.addSigs(fundingKey.publicKey, remoteFundingPubKey, localSig, remoteSig)
670671
// We verify the remote signature when receiving their commit_sig, so this check should always pass.
@@ -681,11 +682,12 @@ object Commitment {
681682
localFundingKey: PrivateKey,
682683
remoteFundingPubKey: PublicKey,
683684
commitmentInput: InputInfo,
684-
spec: CommitmentSpec): (CommitTx, Seq[HtlcTx]) = {
685+
spec: CommitmentSpec): ((CommitTx, RedeemInfo), Seq[(HtlcTx, RedeemInfo)]) = {
685686
val outputs = makeCommitTxOutputs(localFundingKey.publicKey, remoteFundingPubKey, commitKeys.publicKeys, params.localParams.paysCommitTxFees, params.localParams.dustLimit, params.remoteParams.toSelfDelay, spec, params.commitmentFormat)
686687
val commitTx = makeCommitTx(commitmentInput, commitTxNumber, commitKeys.ourPaymentBasePoint, params.remoteParams.paymentBasepoint, params.localParams.isChannelOpener, outputs)
688+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey.publicKey, remoteFundingPubKey, params.commitmentFormat)
687689
val htlcTxs = makeHtlcTxs(commitTx.tx, outputs, params.commitmentFormat)
688-
(commitTx, htlcTxs)
690+
(commitTx -> redeemInfo, htlcTxs)
689691
}
690692

691693
def makeRemoteTxs(params: ChannelParams,
@@ -694,11 +696,12 @@ object Commitment {
694696
localFundingKey: PrivateKey,
695697
remoteFundingPubKey: PublicKey,
696698
commitmentInput: InputInfo,
697-
spec: CommitmentSpec): (CommitTx, Seq[HtlcTx]) = {
699+
spec: CommitmentSpec): ((CommitTx, RedeemInfo), Seq[(HtlcTx, RedeemInfo)]) = {
698700
val outputs = makeCommitTxOutputs(remoteFundingPubKey, localFundingKey.publicKey, commitKeys.publicKeys, !params.localParams.paysCommitTxFees, params.remoteParams.dustLimit, params.localParams.toSelfDelay, spec, params.commitmentFormat)
699701
val commitTx = makeCommitTx(commitmentInput, commitTxNumber, params.remoteParams.paymentBasepoint, commitKeys.ourPaymentBasePoint, !params.localParams.isChannelOpener, outputs)
702+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey.publicKey, remoteFundingPubKey, params.commitmentFormat)
700703
val htlcTxs = makeHtlcTxs(commitTx.tx, outputs, params.commitmentFormat)
701-
(commitTx, htlcTxs)
704+
(commitTx -> redeemInfo, htlcTxs)
702705
}
703706
}
704707

@@ -1131,11 +1134,8 @@ case class Commitments(params: ChannelParams,
11311134
active.forall { commitment =>
11321135
val localFundingKey = channelKeys.fundingKey(commitment.fundingTxIndex).publicKey
11331136
val remoteFundingKey = commitment.remoteFundingPubKey
1134-
val fundingScript = Scripts.multiSig2of2(localFundingKey, remoteFundingKey)
1135-
commitment.commitInput.redeemInfo match {
1136-
case RedeemInfo.SegwitV0(redeemScript) => redeemScript == fundingScript
1137-
case _ => false
1138-
}
1137+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey, remoteFundingKey, params.commitmentFormat)
1138+
commitment.commitInput.txOut.publicKeyScript == Script.write(redeemInfo.publicKeyScript)
11391139
}
11401140
}
11411141

eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,15 @@ object Helpers {
375375
case SimpleTaprootChannelCommitmentFormat => write(Taproot.musig2FundingScript(localFundingKey, remoteFundingKey))
376376
}
377377

378-
def makeFundingInputInfo(fundingTxId: TxId, fundingTxOutputIndex: Int, fundingSatoshis: Satoshi, fundingPubkey1: PublicKey, fundingPubkey2: PublicKey, commitmentFormat: CommitmentFormat): InputInfo = commitmentFormat match {
379-
case SimpleTaprootChannelCommitmentFormat =>
380-
val fundingScript = Taproot.musig2FundingScript(fundingPubkey1, fundingPubkey2)
381-
val fundingTxOut = TxOut(fundingSatoshis, fundingScript)
382-
InputInfo(OutPoint(fundingTxId, fundingTxOutputIndex), fundingTxOut, RedeemInfo.TaprootKeyPath(Taproot.musig2Aggregate(fundingPubkey1, fundingPubkey2), None))
383-
case DefaultCommitmentFormat | _: AnchorOutputsCommitmentFormat =>
384-
val fundingScript = multiSig2of2(fundingPubkey1, fundingPubkey2)
385-
val fundingTxOut = TxOut(fundingSatoshis, pay2wsh(fundingScript))
386-
InputInfo(OutPoint(fundingTxId, fundingTxOutputIndex), fundingTxOut, fundingScript)
378+
def makeFundingRedeemInfo(fundingPubkey1: PublicKey, fundingPubkey2: PublicKey, commitmentFormat: CommitmentFormat): RedeemInfo = commitmentFormat match {
379+
case SimpleTaprootChannelCommitmentFormat => RedeemInfo.TaprootKeyPath(Taproot.musig2Aggregate(fundingPubkey1, fundingPubkey2), None)
380+
case DefaultCommitmentFormat | _: AnchorOutputsCommitmentFormat => RedeemInfo.SegwitV0(multiSig2of2(fundingPubkey1, fundingPubkey2))
381+
}
382+
383+
def makeFundingInputInfo(fundingTxId: TxId, fundingTxOutputIndex: Int, fundingSatoshis: Satoshi, fundingPubkey1: PublicKey, fundingPubkey2: PublicKey, commitmentFormat: CommitmentFormat): InputInfo = {
384+
val redeemInfo = makeFundingRedeemInfo(fundingPubkey1, fundingPubkey2, commitmentFormat)
385+
val fundingTxOut = TxOut(fundingSatoshis, redeemInfo.publicKeyScript)
386+
InputInfo(OutPoint(fundingTxId, fundingTxOutputIndex), fundingTxOut)
387387
}
388388

389389
/**
@@ -397,7 +397,7 @@ object Helpers {
397397
commitTxFeerate: FeeratePerKw,
398398
fundingTxId: TxId, fundingTxOutputIndex: Int,
399399
localFundingKey: PrivateKey, remoteFundingPubKey: PublicKey,
400-
localCommitKeys: LocalCommitmentKeys, remoteCommitKeys: RemoteCommitmentKeys): Either[ChannelException, (CommitmentSpec, CommitTx, CommitmentSpec, CommitTx)] = {
400+
localCommitKeys: LocalCommitmentKeys, remoteCommitKeys: RemoteCommitmentKeys): Either[ChannelException, (CommitmentSpec, (CommitTx, RedeemInfo), CommitmentSpec, (CommitTx, RedeemInfo))] = {
401401
makeCommitTxs(params,
402402
fundingAmount = localFundingAmount + remoteFundingAmount,
403403
toLocal = localFundingAmount.toMilliSatoshi - localPushAmount + remotePushAmount,
@@ -426,7 +426,7 @@ object Helpers {
426426
fundingTxId: TxId, fundingTxOutputIndex: Int,
427427
localFundingKey: PrivateKey, remoteFundingPubKey: PublicKey,
428428
localCommitKeys: LocalCommitmentKeys, remoteCommitKeys: RemoteCommitmentKeys,
429-
localCommitmentIndex: Long, remoteCommitmentIndex: Long): Either[ChannelException, (CommitmentSpec, CommitTx, CommitmentSpec, CommitTx, Seq[HtlcTx])] = {
429+
localCommitmentIndex: Long, remoteCommitmentIndex: Long): Either[ChannelException, (CommitmentSpec, (CommitTx, RedeemInfo), CommitmentSpec, (CommitTx, RedeemInfo), Seq[(HtlcTx, RedeemInfo)])] = {
430430
val localSpec = CommitmentSpec(localHtlcs, commitTxFeerate, toLocal = toLocal, toRemote = toRemote)
431431
val remoteSpec = CommitmentSpec(localHtlcs.map(_.opposite), commitTxFeerate, toLocal = toRemote, toRemote = toLocal)
432432

@@ -445,7 +445,7 @@ object Helpers {
445445
val commitmentInput = makeFundingInputInfo(fundingTxId, fundingTxOutputIndex, fundingAmount, localFundingKey.publicKey, remoteFundingPubKey, params.commitmentFormat)
446446
val (localCommitTx, _) = Commitment.makeLocalTxs(params, localCommitKeys, localCommitmentIndex, localFundingKey, remoteFundingPubKey, commitmentInput, localSpec)
447447
val (remoteCommitTx, htlcTxs) = Commitment.makeRemoteTxs(params, remoteCommitKeys, remoteCommitmentIndex, localFundingKey, remoteFundingPubKey, commitmentInput, remoteSpec)
448-
val sortedHtlcTxs = htlcTxs.sortBy(_.input.outPoint.index)
448+
val sortedHtlcTxs = htlcTxs.sortBy(_._1.input.outPoint.index)
449449
Right(localSpec, localCommitTx, remoteSpec, remoteCommitTx, sortedHtlcTxs)
450450
}
451451

@@ -700,7 +700,8 @@ object Helpers {
700700
log.debug("making closing tx with closing fee={} and commitments:\n{}", closingFees.preferred, commitment.specs2String)
701701
val dustLimit = commitment.localParams.dustLimit.max(commitment.remoteParams.dustLimit)
702702
val closingTx = Transactions.makeClosingTx(commitment.commitInput, localScriptPubkey, remoteScriptPubkey, commitment.localParams.paysClosingFees, dustLimit, closingFees.preferred, commitment.localCommit.spec)
703-
val localClosingSig = closingTx.sign(channelKeys.fundingKey(commitment.fundingTxIndex), TxOwner.Local, commitment.params.commitmentFormat, Map.empty)
703+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(channelKeys.fundingKey(commitment.fundingTxIndex).publicKey, commitment.remoteFundingPubKey, commitment.params.commitmentFormat)
704+
val localClosingSig = closingTx.sign(channelKeys.fundingKey(commitment.fundingTxIndex), redeemInfo, TxOwner.Local, commitment.params.commitmentFormat, Map.empty)
704705
val closingSigned = ClosingSigned(commitment.channelId, closingFees.preferred, localClosingSig, TlvStream(ClosingSignedTlv.FeeRange(closingFees.min, closingFees.max)))
705706
log.debug(s"signed closing txid=${closingTx.tx.txid} with closing fee=${closingSigned.feeSatoshis}")
706707
log.debug(s"closingTxid=${closingTx.tx.txid} closingTx=${closingTx.tx}}")
@@ -739,10 +740,11 @@ object Helpers {
739740
case _ => return Left(CannotGenerateClosingTx(commitment.channelId))
740741
}
741742
val localFundingKey = channelKeys.fundingKey(commitment.fundingTxIndex)
743+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey.publicKey, commitment.remoteFundingPubKey, commitment.params.commitmentFormat)
742744
val closingComplete = ClosingComplete(commitment.channelId, localScriptPubkey, remoteScriptPubkey, closingFee.fee, currentBlockHeight.toLong, TlvStream(Set(
743-
closingTxs.localAndRemote_opt.map(tx => ClosingTlv.CloserAndCloseeOutputs(tx.sign(localFundingKey, TxOwner.Local, commitment.params.commitmentFormat, Map.empty))),
744-
closingTxs.localOnly_opt.map(tx => ClosingTlv.CloserOutputOnly(tx.sign(localFundingKey, TxOwner.Local, commitment.params.commitmentFormat, Map.empty))),
745-
closingTxs.remoteOnly_opt.map(tx => ClosingTlv.CloseeOutputOnly(tx.sign(localFundingKey, TxOwner.Local, commitment.params.commitmentFormat, Map.empty))),
745+
closingTxs.localAndRemote_opt.map(tx => ClosingTlv.CloserAndCloseeOutputs(tx.sign(localFundingKey, redeemInfo, TxOwner.Local, commitment.params.commitmentFormat, Map.empty))),
746+
closingTxs.localOnly_opt.map(tx => ClosingTlv.CloserOutputOnly(tx.sign(localFundingKey, redeemInfo, TxOwner.Local, commitment.params.commitmentFormat, Map.empty))),
747+
closingTxs.remoteOnly_opt.map(tx => ClosingTlv.CloseeOutputOnly(tx.sign(localFundingKey, redeemInfo, TxOwner.Local, commitment.params.commitmentFormat, Map.empty))),
746748
).flatten[ClosingTlv]))
747749
Right(closingTxs, closingComplete)
748750
}
@@ -773,7 +775,8 @@ object Helpers {
773775
closingTxsWithSigs.headOption match {
774776
case Some((closingTx, remoteSig, sigToTlv)) =>
775777
val localFundingKey = channelKeys.fundingKey(commitment.fundingTxIndex)
776-
val localSig = closingTx.sign(localFundingKey, TxOwner.Local, commitment.params.commitmentFormat, Map.empty)
778+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey.publicKey, commitment.remoteFundingPubKey, commitment.params.commitmentFormat)
779+
val localSig = closingTx.sign(localFundingKey, redeemInfo, TxOwner.Local, commitment.params.commitmentFormat, Map.empty)
777780
val signedClosingTx = closingTx.addSigs(localFundingKey.publicKey, commitment.remoteFundingPubKey, localSig, remoteSig)
778781
Transactions.checkSpendable(signedClosingTx) match {
779782
case Failure(_) => Left(InvalidCloseSignature(commitment.channelId, signedClosingTx.tx.txid))
@@ -799,7 +802,8 @@ object Helpers {
799802
closingTxsWithSig.headOption match {
800803
case Some((closingTx, remoteSig)) =>
801804
val localFundingKey = channelKeys.fundingKey(commitment.fundingTxIndex)
802-
val localSig = closingTx.sign(localFundingKey, TxOwner.Local, commitment.params.commitmentFormat, Map.empty)
805+
val redeemInfo = Helpers.Funding.makeFundingRedeemInfo(localFundingKey.publicKey, commitment.remoteFundingPubKey, commitment.params.commitmentFormat)
806+
val localSig = closingTx.sign(localFundingKey, redeemInfo, TxOwner.Local, commitment.params.commitmentFormat, Map.empty)
803807
val signedClosingTx = closingTx.addSigs(localFundingKey.publicKey, commitment.remoteFundingPubKey, localSig, remoteSig)
804808
Transactions.checkSpendable(signedClosingTx) match {
805809
case Failure(_) => Left(InvalidCloseSignature(commitment.channelId, signedClosingTx.tx.txid))

0 commit comments

Comments
 (0)