@@ -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 }
@@ -945,7 +945,7 @@ object Helpers {
945945 if (hash2Preimage.contains(paymentHash)) {
946946 // incoming htlc for which we have the preimage: we can spend it immediately
947947 Some (txInfo.input.outPoint -> withTxGenerationLog(" htlc-success" ) {
948- val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
948+ val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
949949 Right (Transactions .addSigs(txInfo, localSig, remoteSig, hash2Preimage(paymentHash), commitment.params.commitmentFormat))
950950 })
951951 } else if (failedIncomingHtlcs.contains(txInfo.htlcId)) {
@@ -962,7 +962,7 @@ object Helpers {
962962 case HtlcTxAndRemoteSig (txInfo : HtlcTimeoutTx , remoteSig) =>
963963 // outgoing htlc: they may or may not have the preimage, the only thing to do is try to get back our funds after timeout
964964 Some (txInfo.input.outPoint -> withTxGenerationLog(" htlc-timeout" ) {
965- val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
965+ val localSig = keyManager.sign(txInfo, keyManager.htlcPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
966966 Right (Transactions .addSigs(txInfo, localSig, remoteSig, commitment.params.commitmentFormat))
967967 })
968968 }.flatten.toMap
@@ -983,7 +983,7 @@ object Helpers {
983983 val localDelayedPubkey = Generators .derivePubKey(keyManager.delayedPaymentPoint(channelKeyPath).publicKey, localPerCommitmentPoint)
984984 val htlcDelayedTx = withTxGenerationLog(" htlc-delayed" ) {
985985 Transactions .makeHtlcDelayedTx(tx, commitment.localParams.dustLimit, localRevocationPubkey, commitment.remoteParams.toSelfDelay, localDelayedPubkey, finalScriptPubKey, feeratePerKwDelayed).map(claimDelayed => {
986- val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
986+ val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
987987 Transactions .addSigs(claimDelayed, sig)
988988 })
989989 }
@@ -1065,13 +1065,13 @@ object Helpers {
10651065 params.commitmentFormat match {
10661066 case DefaultCommitmentFormat => withTxGenerationLog(" remote-main" ) {
10671067 Transactions .makeClaimP2WPKHOutputTx(tx, params.localParams.dustLimit, localPubkey, finalScriptPubKey, feeratePerKwMain).map(claimMain => {
1068- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , params.commitmentFormat, Nil )
1068+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , params.commitmentFormat, Map .empty )
10691069 Transactions .addSigs(claimMain, localPubkey, sig)
10701070 })
10711071 }
10721072 case _ : AnchorOutputsCommitmentFormat => withTxGenerationLog(" remote-main-delayed" ) {
10731073 Transactions .makeClaimRemoteDelayedOutputTx(tx, params.localParams.dustLimit, localPaymentPoint, finalScriptPubKey, feeratePerKwMain).map(claimMain => {
1074- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , params.commitmentFormat, Nil )
1074+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , params.commitmentFormat, Map .empty )
10751075 Transactions .addSigs(claimMain, sig)
10761076 })
10771077 }
@@ -1114,7 +1114,7 @@ object Helpers {
11141114 if (hash2Preimage.contains(add.paymentHash)) {
11151115 // incoming htlc for which we have the preimage: we can spend it immediately
11161116 Some (claimHtlcTx.input.outPoint -> withTxGenerationLog(" claim-htlc-success" ) {
1117- val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
1117+ val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
11181118 Right (Transactions .addSigs(claimHtlcTx, sig, hash2Preimage(add.paymentHash)))
11191119 })
11201120 } else if (failedIncomingHtlcs.contains(add.id)) {
@@ -1133,7 +1133,7 @@ object Helpers {
11331133 Transactions .makeClaimHtlcTimeoutTx(remoteCommitTx.tx, outputs, commitment.localParams.dustLimit, localHtlcPubkey, remoteHtlcPubkey, remoteRevocationPubkey, finalScriptPubKey, add, feeratePerKwHtlc, commitment.params.commitmentFormat)
11341134 }.map(claimHtlcTx => {
11351135 Some (claimHtlcTx.input.outPoint -> withTxGenerationLog(" claim-htlc-timeout" ) {
1136- val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Nil )
1136+ val sig = keyManager.sign(claimHtlcTx, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner .Local , commitment.params.commitmentFormat, Map .empty )
11371137 Right (Transactions .addSigs(claimHtlcTx, sig))
11381138 })
11391139 })
@@ -1201,13 +1201,13 @@ object Helpers {
12011201 case ct => ct.commitmentFormat match {
12021202 case DefaultCommitmentFormat => withTxGenerationLog(" remote-main" ) {
12031203 Transactions .makeClaimP2WPKHOutputTx(commitTx, localParams.dustLimit, localPaymentPubkey, finalScriptPubKey, feerateMain).map(claimMain => {
1204- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , commitmentFormat, Nil )
1204+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner .Local , commitmentFormat, Map .empty )
12051205 Transactions .addSigs(claimMain, localPaymentPubkey, sig)
12061206 })
12071207 }
12081208 case _ : AnchorOutputsCommitmentFormat => withTxGenerationLog(" remote-main-delayed" ) {
12091209 Transactions .makeClaimRemoteDelayedOutputTx(commitTx, localParams.dustLimit, localPaymentPoint, finalScriptPubKey, feerateMain).map(claimMain => {
1210- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , commitmentFormat, Nil )
1210+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), TxOwner .Local , commitmentFormat, Map .empty )
12111211 Transactions .addSigs(claimMain, sig)
12121212 })
12131213 }
@@ -1217,7 +1217,7 @@ object Helpers {
12171217 // then we punish them by stealing their main output
12181218 val mainPenaltyTx = withTxGenerationLog(" main-penalty" ) {
12191219 Transactions .makeMainPenaltyTx(commitTx, localParams.dustLimit, remoteRevocationPubkey, finalScriptPubKey, localParams.toSelfDelay, remoteDelayedPaymentPubkey, feeratePenalty).map(txinfo => {
1220- val sig = keyManager.sign(txinfo, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Nil )
1220+ val sig = keyManager.sign(txinfo, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Map .empty )
12211221 Transactions .addSigs(txinfo, sig)
12221222 })
12231223 }
@@ -1237,7 +1237,7 @@ object Helpers {
12371237 val htlcRedeemScript = htlcsRedeemScripts(txOut.publicKeyScript)
12381238 withTxGenerationLog(" htlc-penalty" ) {
12391239 Transactions .makeHtlcPenaltyTx(commitTx, outputIndex, htlcRedeemScript, localParams.dustLimit, finalScriptPubKey, feeratePenalty).map(htlcPenalty => {
1240- val sig = keyManager.sign(htlcPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Nil )
1240+ val sig = keyManager.sign(htlcPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Map .empty )
12411241 Transactions .addSigs(htlcPenalty, sig, remoteRevocationPubkey)
12421242 })
12431243 }
@@ -1293,7 +1293,7 @@ object Helpers {
12931293 val penaltyTxs = Transactions .makeClaimHtlcDelayedOutputPenaltyTxs(htlcTx, localParams.dustLimit, remoteRevocationPubkey, localParams.toSelfDelay, remoteDelayedPaymentPubkey, finalScriptPubKey, feeratePerKwPenalty).flatMap(claimHtlcDelayedOutputPenaltyTx => {
12941294 withTxGenerationLog(" htlc-delayed-penalty" ) {
12951295 claimHtlcDelayedOutputPenaltyTx.map(htlcDelayedPenalty => {
1296- val sig = keyManager.sign(htlcDelayedPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Nil )
1296+ val sig = keyManager.sign(htlcDelayedPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner .Local , commitmentFormat, Map .empty )
12971297 val signedTx = Transactions .addSigs(htlcDelayedPenalty, sig)
12981298 // we need to make sure that the tx is indeed valid
12991299 Transaction .correctlySpends(signedTx.tx, Seq (htlcTx), ScriptFlags .STANDARD_SCRIPT_VERIFY_FLAGS )
0 commit comments