@@ -701,7 +701,7 @@ object Helpers {
701701 log.debug(" making closing tx with closing fee={} and commitments:\n {}" , closingFees.preferred, commitment.specs2String)
702702 val dustLimit = commitment.localParams.dustLimit.max(commitment.remoteParams.dustLimit)
703703 val closingTx = Transactions .makeClosingTx(commitment.commitInput, localScriptPubkey, remoteScriptPubkey, commitment.localParams.paysClosingFees, dustLimit, closingFees.preferred, commitment.localCommit.spec)
704- val localClosingSig = keyManager.sign(closingTx, keyManager.fundingPublicKey(commitment.localParams.fundingKeyPath, commitment.fundingTxIndex), TxOwner .Local , commitment.params.commitmentFormat, Nil )
704+ val localClosingSig = keyManager.sign(closingTx, keyManager.fundingPublicKey(commitment.localParams.fundingKeyPath, commitment.fundingTxIndex), TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
705705 val closingSigned = ClosingSigned (commitment.channelId, closingFees.preferred, localClosingSig, TlvStream (ClosingSignedTlv .FeeRange (closingFees.min, closingFees.max)))
706706 log.debug(s " signed closing txid= ${closingTx.tx.txid} with closing fee= ${closingSigned.feeSatoshis}" )
707707 log.debug(s " closingTxid= ${closingTx.tx.txid} closingTx= ${closingTx.tx}} " )
@@ -741,9 +741,9 @@ object Helpers {
741741 }
742742 val localFundingPubKey = keyManager.fundingPublicKey(commitment.localParams.fundingKeyPath, commitment.fundingTxIndex)
743743 val closingComplete = ClosingComplete (commitment.channelId, localScriptPubkey, remoteScriptPubkey, closingFee.fee, currentBlockHeight.toLong, TlvStream (Set (
744- closingTxs.localAndRemote_opt.map(tx => ClosingTlv .CloserAndCloseeOutputs (keyManager.sign(tx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Nil ))),
745- closingTxs.localOnly_opt.map(tx => ClosingTlv .CloserOutputOnly (keyManager.sign(tx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Nil ))),
746- closingTxs.remoteOnly_opt.map(tx => ClosingTlv .CloseeOutputOnly (keyManager.sign(tx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Nil ))),
744+ closingTxs.localAndRemote_opt.map(tx => ClosingTlv .CloserAndCloseeOutputs (keyManager.sign(tx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Map .empty ))),
745+ closingTxs.localOnly_opt.map(tx => ClosingTlv .CloserOutputOnly (keyManager.sign(tx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Map .empty ))),
746+ closingTxs.remoteOnly_opt.map(tx => ClosingTlv .CloseeOutputOnly (keyManager.sign(tx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Map .empty ))),
747747 ).flatten[ClosingTlv ]))
748748 Right (closingTxs, closingComplete)
749749 }
@@ -774,7 +774,7 @@ object Helpers {
774774 closingTxsWithSigs.headOption match {
775775 case Some ((closingTx, remoteSig, sigToTlv)) =>
776776 val localFundingPubKey = keyManager.fundingPublicKey(commitment.localParams.fundingKeyPath, commitment.fundingTxIndex)
777- val localSig = keyManager.sign(closingTx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Nil )
777+ val localSig = keyManager.sign(closingTx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
778778 val signedClosingTx = Transactions .addSigs(closingTx, localFundingPubKey.publicKey, commitment.remoteFundingPubKey, localSig, remoteSig)
779779 Transactions .checkSpendable(signedClosingTx) match {
780780 case Failure (_) => Left (InvalidCloseSignature (commitment.channelId, signedClosingTx.tx.txid))
@@ -800,7 +800,7 @@ object Helpers {
800800 closingTxsWithSig.headOption match {
801801 case Some ((closingTx, remoteSig)) =>
802802 val localFundingPubKey = keyManager.fundingPublicKey(commitment.localParams.fundingKeyPath, commitment.fundingTxIndex)
803- val localSig = keyManager.sign(closingTx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Nil )
803+ val localSig = keyManager.sign(closingTx, localFundingPubKey, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
804804 val signedClosingTx = Transactions .addSigs(closingTx, localFundingPubKey.publicKey, commitment.remoteFundingPubKey, localSig, remoteSig)
805805 Transactions .checkSpendable(signedClosingTx) match {
806806 case Failure (_) => Left (InvalidCloseSignature (commitment.channelId, signedClosingTx.tx.txid))
@@ -882,7 +882,7 @@ object Helpers {
882882 // first we will claim our main output as soon as the delay is over
883883 val mainDelayedTx = withTxGenerationLog(" local-main-delayed" ) {
884884 Transactions .makeClaimLocalDelayedOutputTx(tx, commitment.localParams.dustLimit, localRevocationPubkey, commitment.remoteParams.toSelfDelay, localDelayedPubkey, finalScriptPubKey, feeratePerKwDelayed).map(claimDelayed => {
885- val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
885+ val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
886886 Transactions .addSigs(claimDelayed, sig)
887887 })
888888 }
@@ -947,7 +947,7 @@ object Helpers {
947947 if (hash2Preimage.contains(paymentHash)) {
948948 // We immediately spend incoming htlcs for which we have the preimage.
949949 Some (txInfo.input.outPoint -> withTxGenerationLog(" htlc-success" ) {
950- val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
950+ val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
951951 Right (Transactions .addSigs(txInfo, localSig, remoteSig, hash2Preimage(paymentHash), commitment.params.commitmentFormat))
952952 })
953953 } else if (failedIncomingHtlcs.contains(txInfo.htlcId)) {
@@ -968,7 +968,7 @@ object Helpers {
968968 // claim the output, we will learn the preimage from their transaction, otherwise we will get our funds
969969 // back after the timeout.
970970 Some (txInfo.input.outPoint -> withTxGenerationLog(" htlc-timeout" ) {
971- val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
971+ val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
972972 Right (Transactions .addSigs(txInfo, localSig, remoteSig, commitment.params.commitmentFormat))
973973 })
974974 }.flatten.toMap
@@ -991,7 +991,7 @@ object Helpers {
991991 // Note that this will return None if the transaction wasn't one of our HTLC transactions, which may happen
992992 // if our peer was able to claim the HTLC output before us (race condition between success and timeout).
993993 Transactions .makeHtlcDelayedTx(tx, commitment.localParams.dustLimit, localRevocationPubkey, commitment.remoteParams.toSelfDelay, localDelayedPubkey, finalScriptPubKey, feeratePerKwDelayed).map(claimDelayed => {
994- val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
994+ val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
995995 Transactions .addSigs(claimDelayed, sig)
996996 })
997997 }
@@ -1073,13 +1073,13 @@ object Helpers {
10731073 params.commitmentFormat match {
10741074 case DefaultCommitmentFormat => withTxGenerationLog(" remote-main" ) {
10751075 Transactions .makeClaimP2WPKHOutputTx(tx, params.localParams.dustLimit, localPubkey, finalScriptPubKey, feeratePerKwMain).map(claimMain => {
1076- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , params.commitmentFormat, Nil )
1076+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , params.commitmentFormat, Map .empty )
10771077 Transactions .addSigs(claimMain, localPubkey, sig)
10781078 })
10791079 }
10801080 case _ : AnchorOutputsCommitmentFormat => withTxGenerationLog(" remote-main-delayed" ) {
10811081 Transactions .makeClaimRemoteDelayedOutputTx(tx, params.localParams.dustLimit, localPaymentPoint, finalScriptPubKey, feeratePerKwMain).map(claimMain => {
1082- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , params.commitmentFormat, Nil )
1082+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , params.commitmentFormat, Map .empty )
10831083 Transactions .addSigs(claimMain, sig)
10841084 })
10851085 }
@@ -1126,7 +1126,7 @@ object Helpers {
11261126 if (hash2Preimage.contains(add.paymentHash)) {
11271127 // We immediately spend incoming htlcs for which we have the preimage.
11281128 Some (claimHtlcTx.input.outPoint -> withTxGenerationLog(" claim-htlc-success" ) {
1129- val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
1129+ val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
11301130 Right (Transactions .addSigs(claimHtlcTx, sig, hash2Preimage(add.paymentHash)))
11311131 })
11321132 } else if (failedIncomingHtlcs.contains(add.id)) {
@@ -1152,7 +1152,7 @@ object Helpers {
11521152 Transactions .makeClaimHtlcTimeoutTx(remoteCommitTx.tx, outputs, commitment.localParams.dustLimit, localHtlcPubkey, remoteHtlcPubkey, remoteRevocationPubkey, finalScriptPubKey, add, feeratePerKwHtlc, commitment.params.commitmentFormat)
11531153 }.map(claimHtlcTx => {
11541154 Some (claimHtlcTx.input.outPoint -> withTxGenerationLog(" claim-htlc-timeout" ) {
1155- val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
1155+ val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
11561156 Right (Transactions .addSigs(claimHtlcTx, sig))
11571157 })
11581158 })
@@ -1220,13 +1220,13 @@ object Helpers {
12201220 case ct => ct.commitmentFormat match {
12211221 case DefaultCommitmentFormat => withTxGenerationLog(" remote-main" ) {
12221222 Transactions .makeClaimP2WPKHOutputTx(commitTx, localParams.dustLimit, localPaymentPubkey, finalScriptPubKey, feerateMain).map(claimMain => {
1223- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , commitmentFormat, Nil )
1223+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , commitmentFormat, Map .empty )
12241224 Transactions .addSigs(claimMain, localPaymentPubkey, sig)
12251225 })
12261226 }
12271227 case _ : AnchorOutputsCommitmentFormat => withTxGenerationLog(" remote-main-delayed" ) {
12281228 Transactions .makeClaimRemoteDelayedOutputTx(commitTx, localParams.dustLimit, localPaymentPoint, finalScriptPubKey, feerateMain).map(claimMain => {
1229- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , commitmentFormat, Nil )
1229+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , commitmentFormat, Map .empty )
12301230 Transactions .addSigs(claimMain, sig)
12311231 })
12321232 }
@@ -1236,7 +1236,7 @@ object Helpers {
12361236 // then we punish them by stealing their main output
12371237 val mainPenaltyTx = withTxGenerationLog(" main-penalty" ) {
12381238 Transactions .makeMainPenaltyTx(commitTx, localParams.dustLimit, remoteRevocationPubkey, finalScriptPubKey, localParams.toSelfDelay, remoteDelayedPaymentPubkey, feeratePenalty).map(txinfo => {
1239- val sig = keyManager.sign(txinfo, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Nil )
1239+ val sig = keyManager.sign(txinfo, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Map .empty )
12401240 Transactions .addSigs(txinfo, sig)
12411241 })
12421242 }
@@ -1256,7 +1256,7 @@ object Helpers {
12561256 val htlcRedeemScript = htlcsRedeemScripts(txOut.publicKeyScript)
12571257 withTxGenerationLog(" htlc-penalty" ) {
12581258 Transactions .makeHtlcPenaltyTx(commitTx, outputIndex, htlcRedeemScript, localParams.dustLimit, finalScriptPubKey, feeratePenalty).map(htlcPenalty => {
1259- val sig = keyManager.sign(htlcPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Nil )
1259+ val sig = keyManager.sign(htlcPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Map .empty )
12601260 Transactions .addSigs(htlcPenalty, sig, remoteRevocationPubkey)
12611261 })
12621262 }
@@ -1312,7 +1312,7 @@ object Helpers {
13121312 val penaltyTxs = Transactions .makeClaimHtlcDelayedOutputPenaltyTxs(htlcTx, localParams.dustLimit, remoteRevocationPubkey, localParams.toSelfDelay, remoteDelayedPaymentPubkey, finalScriptPubKey, feeratePerKwPenalty).flatMap(claimHtlcDelayedOutputPenaltyTx => {
13131313 withTxGenerationLog(" htlc-delayed-penalty" ) {
13141314 claimHtlcDelayedOutputPenaltyTx.map(htlcDelayedPenalty => {
1315- val sig = keyManager.sign(htlcDelayedPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Nil )
1315+ val sig = keyManager.sign(htlcDelayedPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Map .empty )
13161316 val signedTx = Transactions .addSigs(htlcDelayedPenalty, sig)
13171317 // We need to make sure that the tx is indeed valid.
13181318 Transaction .correctlySpends(signedTx.tx, Seq (htlcTx), ScriptFlags .STANDARD_SCRIPT_VERIFY_FLAGS )
0 commit comments