@@ -475,7 +475,7 @@ object Helpers {
475475 log.debug(" making closing tx with closingFee={} and commitments:\n {}" , closingFee, Commitments .specs2String(commitments))
476476 val dustLimitSatoshis = localParams.dustLimit.max(remoteParams.dustLimit)
477477 val closingTx = Transactions .makeClosingTx(commitInput, localScriptPubkey, remoteScriptPubkey, localParams.isFunder, dustLimitSatoshis, closingFee, localCommit.spec)
478- val localClosingSig = keyManager.sign(closingTx, keyManager.fundingPublicKey(commitments.localParams.fundingKeyPath))
478+ val localClosingSig = keyManager.sign(closingTx, keyManager.fundingPublicKey(commitments.localParams.fundingKeyPath), TxOwner . Local , commitmentFormat )
479479 val closingSigned = ClosingSigned (channelId, closingFee, localClosingSig)
480480 log.info(s " signed closing txid= ${closingTx.tx.txid} with closingFeeSatoshis= ${closingSigned.feeSatoshis}" )
481481 log.debug(s " closingTxid= ${closingTx.tx.txid} closingTx= ${closingTx.tx}} " )
@@ -534,7 +534,7 @@ object Helpers {
534534 // first we will claim our main output as soon as the delay is over
535535 val mainDelayedTx = generateTx(" main-delayed-output" ) {
536536 Transactions .makeClaimDelayedOutputTx(tx, localParams.dustLimit, localRevocationPubkey, remoteParams.toSelfDelay, localDelayedPubkey, localParams.defaultFinalScriptPubKey, feeratePerKwDelayed).right.map(claimDelayed => {
537- val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, SIGHASH_ALL )
537+ val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner . Local , commitmentFormat )
538538 Transactions .addSigs(claimDelayed, sig)
539539 })
540540 }
@@ -564,7 +564,7 @@ object Helpers {
564564 txinfo : TransactionWithInputInfo =>
565565 generateTx(" claim-htlc-delayed" ) {
566566 Transactions .makeClaimDelayedOutputTx(txinfo.tx, localParams.dustLimit, localRevocationPubkey, remoteParams.toSelfDelay, localDelayedPubkey, localParams.defaultFinalScriptPubKey, feeratePerKwDelayed).right.map(claimDelayed => {
567- val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, SIGHASH_ALL )
567+ val sig = keyManager.sign(claimDelayed, keyManager.delayedPaymentPoint(channelKeyPath), localPerCommitmentPoint, TxOwner . Local , commitmentFormat )
568568 Transactions .addSigs(claimDelayed, sig)
569569 })
570570 }
@@ -615,7 +615,7 @@ object Helpers {
615615 case OutgoingHtlc (add : UpdateAddHtlc ) if preimages.exists(r => sha256(r) == add.paymentHash) => generateTx(" claim-htlc-success" ) {
616616 val preimage = preimages.find(r => sha256(r) == add.paymentHash).get
617617 Transactions .makeClaimHtlcSuccessTx(remoteCommitTx.tx, outputs, localParams.dustLimit, localHtlcPubkey, remoteHtlcPubkey, remoteRevocationPubkey, localParams.defaultFinalScriptPubKey, add, feeratePerKwHtlc, commitments.commitmentFormat).right.map(txinfo => {
618- val sig = keyManager.sign(txinfo, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, SIGHASH_ALL )
618+ val sig = keyManager.sign(txinfo, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner . Local , commitments.commitmentFormat )
619619 Transactions .addSigs(txinfo, sig, preimage)
620620 })
621621 }
@@ -625,7 +625,7 @@ object Helpers {
625625 // outgoing htlc: they may or may not have the preimage, the only thing to do is try to get back our funds after timeout
626626 case IncomingHtlc (add : UpdateAddHtlc ) => generateTx(" claim-htlc-timeout" ) {
627627 Transactions .makeClaimHtlcTimeoutTx(remoteCommitTx.tx, outputs, localParams.dustLimit, localHtlcPubkey, remoteHtlcPubkey, remoteRevocationPubkey, localParams.defaultFinalScriptPubKey, add, feeratePerKwHtlc, commitments.commitmentFormat).right.map(txinfo => {
628- val sig = keyManager.sign(txinfo, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, SIGHASH_ALL )
628+ val sig = keyManager.sign(txinfo, keyManager.htlcPoint(channelKeyPath), remoteCommit.remotePerCommitmentPoint, TxOwner . Local , commitments.commitmentFormat )
629629 Transactions .addSigs(txinfo, sig)
630630 })
631631 }
@@ -665,7 +665,7 @@ object Helpers {
665665
666666 val mainTx = generateTx(" claim-p2wpkh-output" ) {
667667 Transactions .makeClaimP2WPKHOutputTx(tx, commitments.localParams.dustLimit, localPubkey, commitments.localParams.defaultFinalScriptPubKey, feeratePerKwMain).right.map(claimMain => {
668- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, SIGHASH_ALL )
668+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner . Local , commitments.commitmentFormat )
669669 Transactions .addSigs(claimMain, localPubkey, sig)
670670 })
671671 }
@@ -720,7 +720,7 @@ object Helpers {
720720 None
721721 case _ => generateTx(" claim-p2wpkh-output" ) {
722722 Transactions .makeClaimP2WPKHOutputTx(tx, localParams.dustLimit, localPaymentPubkey, localParams.defaultFinalScriptPubKey, feeratePerKwMain).right.map(claimMain => {
723- val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, SIGHASH_ALL )
723+ val sig = keyManager.sign(claimMain, keyManager.paymentPoint(channelKeyPath), remotePerCommitmentPoint, TxOwner . Local , commitmentFormat )
724724 Transactions .addSigs(claimMain, localPaymentPubkey, sig)
725725 })
726726 }
@@ -729,7 +729,7 @@ object Helpers {
729729 // then we punish them by stealing their main output
730730 val mainPenaltyTx = generateTx(" main-penalty" ) {
731731 Transactions .makeMainPenaltyTx(tx, localParams.dustLimit, remoteRevocationPubkey, localParams.defaultFinalScriptPubKey, localParams.toSelfDelay, remoteDelayedPaymentPubkey, feeratePerKwPenalty).right.map(txinfo => {
732- val sig = keyManager.sign(txinfo, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret)
732+ val sig = keyManager.sign(txinfo, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner . Local , commitmentFormat )
733733 Transactions .addSigs(txinfo, sig)
734734 })
735735 }
@@ -749,7 +749,7 @@ object Helpers {
749749 val htlcRedeemScript = htlcsRedeemScripts(txOut.publicKeyScript)
750750 generateTx(" htlc-penalty" ) {
751751 Transactions .makeHtlcPenaltyTx(tx, outputIndex, htlcRedeemScript, localParams.dustLimit, localParams.defaultFinalScriptPubKey, feeratePerKwPenalty).right.map(htlcPenalty => {
752- val sig = keyManager.sign(htlcPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret)
752+ val sig = keyManager.sign(htlcPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner . Local , commitmentFormat )
753753 Transactions .addSigs(htlcPenalty, sig, remoteRevocationPubkey)
754754 })
755755 }
@@ -800,7 +800,7 @@ object Helpers {
800800
801801 generateTx(" claim-htlc-delayed-penalty" ) {
802802 Transactions .makeClaimDelayedOutputPenaltyTx(htlcTx, localParams.dustLimit, remoteRevocationPubkey, localParams.toSelfDelay, remoteDelayedPaymentPubkey, localParams.defaultFinalScriptPubKey, feeratePerKwPenalty).right.map(htlcDelayedPenalty => {
803- val sig = keyManager.sign(htlcDelayedPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret)
803+ val sig = keyManager.sign(htlcDelayedPenalty, keyManager.revocationPoint(channelKeyPath), remotePerCommitmentSecret, TxOwner . Local , commitmentFormat )
804804 val signedTx = Transactions .addSigs(htlcDelayedPenalty, sig)
805805 // we need to make sure that the tx is indeed valid
806806 Transaction .correctlySpends(signedTx.tx, Seq (htlcTx), ScriptFlags .STANDARD_SCRIPT_VERIFY_FLAGS )
0 commit comments