Skip to content

Commit a544e88

Browse files
committed
Fixup: create and match segwit and taproot inputs explicitly
1 parent 7cf5829 commit a544e88

16 files changed

+40
-48
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trait SpendFromChannelAddress {
4343
inputTx <- appKit.wallet.getTransaction(outPoint.txid)
4444
localFundingPubkey = appKit.nodeParams.channelKeyManager.fundingPublicKey(fundingKeyPath, fundingTxIndex)
4545
fundingRedeemScript = multiSig2of2(localFundingPubkey.publicKey, remoteFundingPubkey)
46-
inputInfo = InputInfo(outPoint, inputTx.txOut(outPoint.index.toInt), fundingRedeemScript)
46+
inputInfo = InputInfo.SegwitInput(outPoint, inputTx.txOut(outPoint.index.toInt), fundingRedeemScript)
4747
localSig = appKit.nodeParams.channelKeyManager.sign(
4848
Transactions.SpliceTx(inputInfo, unsignedTx), // classify as splice, doesn't really matter
4949
localFundingPubkey,

eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/Channel.scala

+6-8
Original file line numberDiff line numberDiff line change
@@ -1024,10 +1024,9 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
10241024
val parentCommitment = d.commitments.latest.commitment
10251025
val localFundingPubKey = nodeParams.channelKeyManager.fundingPublicKey(d.commitments.params.localParams.fundingKeyPath, parentCommitment.fundingTxIndex + 1).publicKey
10261026
val fundingScript = Funding.makeFundingPubKeyScript(localFundingPubKey, msg.fundingPubKey, d.commitments.latest.params.commitmentFormat)
1027-
val sharedInput = if (d.commitments.latest.commitInput.isP2tr) {
1028-
Musig2Input(parentCommitment)
1029-
} else {
1030-
Multisig2of2Input(parentCommitment)
1027+
val sharedInput = d.commitments.latest.commitInput match {
1028+
case _: Transactions.InputInfo.TaprootInput => Musig2Input(parentCommitment)
1029+
case _ => Multisig2of2Input(parentCommitment)
10311030
}
10321031
LiquidityAds.validateRequest(nodeParams.privateKey, d.channelId, fundingScript, msg.feerate, isChannelCreation = false, msg.requestFunding_opt, nodeParams.liquidityAdsConfig.rates_opt, msg.useFeeCredit_opt) match {
10331032
case Left(t) =>
@@ -1086,10 +1085,9 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
10861085
case SpliceStatus.SpliceRequested(cmd, spliceInit) =>
10871086
log.info("our peer accepted our splice request and will contribute {} to the funding transaction", msg.fundingContribution)
10881087
val parentCommitment = d.commitments.latest.commitment
1089-
val sharedInput = if (d.commitments.latest.commitInput.isP2tr) {
1090-
Musig2Input(parentCommitment)
1091-
} else {
1092-
Multisig2of2Input(parentCommitment)
1088+
val sharedInput = d.commitments.latest.commitInput match {
1089+
case _: Transactions.InputInfo.TaprootInput => Musig2Input(parentCommitment)
1090+
case _ => Multisig2of2Input(parentCommitment)
10931091
}
10941092
val fundingParams = InteractiveTxParams(
10951093
channelId = d.channelId,

eclair-core/src/main/scala/fr/acinq/eclair/transactions/Transactions.scala

+3-9
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ object Transactions {
112112
sealed trait InputInfo {
113113
val outPoint: OutPoint
114114
val txOut: TxOut
115-
val isP2tr: Boolean = Try(Script.isPay2tr(Script.parse(txOut.publicKeyScript))).getOrElse(false)
116115
}
117116

118117
object InputInfo {
@@ -121,11 +120,6 @@ object Transactions {
121120
def apply(outPoint: OutPoint, txOut: TxOut, redeemScript: Seq[ScriptElt]) = new SegwitInput(outPoint, txOut, Script.write(redeemScript))
122121
}
123122
case class TaprootInput(outPoint: OutPoint, txOut: TxOut, internalKey: XonlyPublicKey, scriptTree_opt: Option[ScriptTree], leaf: ByteVector32) extends InputInfo
124-
125-
126-
def apply(outPoint: OutPoint, txOut: TxOut, redeemScript: ByteVector): SegwitInput = SegwitInput(outPoint, txOut, redeemScript)
127-
def apply(outPoint: OutPoint, txOut: TxOut, redeemScript: Seq[ScriptElt]): SegwitInput = SegwitInput(outPoint, txOut, Script.write(redeemScript))
128-
//def apply(outPoint: OutPoint, txOut: TxOut, internalKey: XonlyPublicKey, scriptTree_opt: Option[ScriptTree]): TaprootInput = TaprootInput(outPoint, txOut, internalKey, scriptTree_opt)
129123
}
130124

131125
/** Owner of a given transaction (local/remote). */
@@ -756,7 +750,7 @@ object Transactions {
756750
)
757751
Right(HtlcSuccessTx(input, tx, htlc.paymentHash, htlc.id, ConfirmationTarget.Absolute(BlockHeight(htlc.cltvExpiry.toLong))))
758752
case s: CommitmentOutputLink.SegwitLink[InHtlc] =>
759-
val input = InputInfo(OutPoint(commitTx, outputIndex), commitTx.txOut(outputIndex), s.redeemScript)
753+
val input = InputInfo.SegwitInput(OutPoint(commitTx, outputIndex), commitTx.txOut(outputIndex), s.redeemScript)
760754
val tx = Transaction(
761755
version = 2,
762756
txIn = TxIn(input.outPoint, ByteVector.empty, getHtlcTxInputSequence(commitmentFormat)) :: Nil,
@@ -882,7 +876,7 @@ object Transactions {
882876
findPubKeyScriptIndex(commitTx, pubkeyScript) match {
883877
case Left(skip) => Left(skip)
884878
case Right(outputIndex) =>
885-
val input = InputInfo(OutPoint(commitTx, outputIndex), commitTx.txOut(outputIndex), write(redeemScript))
879+
val input = InputInfo.SegwitInput(OutPoint(commitTx, outputIndex), commitTx.txOut(outputIndex), write(redeemScript))
886880
// unsigned tx
887881
val tx = Transaction(
888882
version = 2,
@@ -1167,7 +1161,7 @@ object Transactions {
11671161
* We already have the redeemScript, no need to build it
11681162
*/
11691163
def makeHtlcPenaltyTx(commitTx: Transaction, htlcOutputIndex: Int, redeemScript: ByteVector, localDustLimit: Satoshi, localFinalScriptPubKey: ByteVector, feeratePerKw: FeeratePerKw): Either[TxGenerationSkipped, HtlcPenaltyTx] = {
1170-
val input = InputInfo(OutPoint(commitTx, htlcOutputIndex), commitTx.txOut(htlcOutputIndex), redeemScript)
1164+
val input = InputInfo.SegwitInput(OutPoint(commitTx, htlcOutputIndex), commitTx.txOut(htlcOutputIndex), redeemScript)
11711165
// unsigned transaction
11721166
val tx = Transaction(
11731167
version = 2,

eclair-core/src/main/scala/fr/acinq/eclair/wire/internal/channel/version0/ChannelTypes0.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private[channel] object ChannelTypes0 {
4848
// modified: we don't use the InputInfo in closing business logic, so we don't need to fill everything (this part
4949
// assumes that we only have standard channels, no anchor output channels - which was the case before version2).
5050
val input = childTx.txIn.head.outPoint
51-
InputInfo(input, parentTx.txOut(input.index.toInt), Nil)
51+
InputInfo.SegwitInput(input, parentTx.txOut(input.index.toInt), Nil)
5252
}
5353

5454
case class LocalCommitPublished(commitTx: Transaction, claimMainDelayedOutputTx: Option[Transaction], htlcSuccessTxs: List[Transaction], htlcTimeoutTxs: List[Transaction], claimHtlcDelayedTxs: List[Transaction], irrevocablySpent: Map[OutPoint, TxId]) {
@@ -97,7 +97,7 @@ private[channel] object ChannelTypes0 {
9797
val htlcPenaltyTxsNew = htlcPenaltyTxs.map(tx => HtlcPenaltyTx(getPartialInputInfo(commitTx, tx), tx))
9898
val claimHtlcDelayedPenaltyTxsNew = claimHtlcDelayedPenaltyTxs.map(tx => {
9999
// We don't have all the `InputInfo` data, but it's ok: we only use the tx that is fully signed.
100-
ClaimHtlcDelayedOutputPenaltyTx(InputInfo(tx.txIn.head.outPoint, TxOut(Satoshi(0), Nil), Nil), tx)
100+
ClaimHtlcDelayedOutputPenaltyTx(InputInfo.SegwitInput(tx.txIn.head.outPoint, TxOut(Satoshi(0), Nil), Nil), tx)
101101
})
102102
channel.RevokedCommitPublished(commitTx, claimMainOutputTxNew, mainPenaltyTxNew, htlcPenaltyTxsNew, claimHtlcDelayedPenaltyTxsNew, irrevocablySpentNew)
103103
}
@@ -108,7 +108,7 @@ private[channel] object ChannelTypes0 {
108108
* the raw transaction. It provides more information for auditing but is not used for business logic, so we can safely
109109
* put dummy values in the migration.
110110
*/
111-
def migrateClosingTx(tx: Transaction): ClosingTx = ClosingTx(InputInfo(tx.txIn.head.outPoint, TxOut(Satoshi(0), Nil), Nil), tx, None)
111+
def migrateClosingTx(tx: Transaction): ClosingTx = ClosingTx(InputInfo.SegwitInput(tx.txIn.head.outPoint, TxOut(Satoshi(0), Nil), Nil), tx, None)
112112

113113
case class HtlcTxAndSigs(txinfo: HtlcTx, localSig: ByteVector64, remoteSig: ByteVector64)
114114

eclair-core/src/test/scala/fr/acinq/eclair/channel/ChannelDataSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ class ChannelDataSpec extends TestKitBaseClass with AnyFunSuiteLike with Channel
600600
case (current, tx) => Closing.updateRevokedCommitPublished(current, tx)
601601
}.copy(
602602
claimHtlcDelayedPenaltyTxs = List(
603-
ClaimHtlcDelayedOutputPenaltyTx(InputInfo(OutPoint(htlcSuccess, 0), TxOut(2_500 sat, Nil), Nil), Transaction(2, Seq(TxIn(OutPoint(htlcSuccess, 0), ByteVector.empty, 0)), Seq(TxOut(5_000 sat, ByteVector.empty)), 0)),
604-
ClaimHtlcDelayedOutputPenaltyTx(InputInfo(OutPoint(htlcTimeout, 0), TxOut(3_000 sat, Nil), Nil), Transaction(2, Seq(TxIn(OutPoint(htlcTimeout, 0), ByteVector.empty, 0)), Seq(TxOut(6_000 sat, ByteVector.empty)), 0))
603+
ClaimHtlcDelayedOutputPenaltyTx(InputInfo.SegwitInput(OutPoint(htlcSuccess, 0), TxOut(2_500 sat, Nil), Nil), Transaction(2, Seq(TxIn(OutPoint(htlcSuccess, 0), ByteVector.empty, 0)), Seq(TxOut(5_000 sat, ByteVector.empty)), 0)),
604+
ClaimHtlcDelayedOutputPenaltyTx(InputInfo.SegwitInput(OutPoint(htlcTimeout, 0), TxOut(3_000 sat, Nil), Nil), Transaction(2, Seq(TxIn(OutPoint(htlcTimeout, 0), ByteVector.empty, 0)), Seq(TxOut(6_000 sat, ByteVector.empty)), 0))
605605
)
606606
)
607607
assert(!rvk4b.isDone)

eclair-core/src/test/scala/fr/acinq/eclair/channel/CommitmentsSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ object CommitmentsSpec {
492492
val localFundingPubKey = randomKey().publicKey
493493
val remoteFundingPubKey = randomKey().publicKey
494494
val fundingTx = Transaction(2, Nil, Seq(TxOut((toLocal + toRemote).truncateToSatoshi, Funding.makeFundingPubKeyScript(localFundingPubKey, remoteFundingPubKey, DefaultCommitmentFormat))), 0)
495-
val commitmentInput = Transactions.InputInfo(OutPoint(fundingTx, 0), fundingTx.txOut.head, Scripts.multiSig2of2(localFundingPubKey, remoteFundingPubKey))
495+
val commitmentInput = Transactions.InputInfo.SegwitInput(OutPoint(fundingTx, 0), fundingTx.txOut.head, Scripts.multiSig2of2(localFundingPubKey, remoteFundingPubKey))
496496
val localCommit = LocalCommit(0, CommitmentSpec(Set.empty, feeRatePerKw, toLocal, toRemote), CommitTxAndRemoteSig(CommitTx(commitmentInput, Transaction(2, Nil, Nil, 0)), ByteVector64.Zeroes), Nil)
497497
val remoteCommit = RemoteCommit(0, CommitmentSpec(Set.empty, feeRatePerKw, toRemote, toLocal), randomTxId(), randomKey().publicKey)
498498
val localFundingStatus = announcement_opt match {
@@ -517,7 +517,7 @@ object CommitmentsSpec {
517517
val localFundingPubKey = randomKey().publicKey
518518
val remoteFundingPubKey = randomKey().publicKey
519519
val fundingTx = Transaction(2, Nil, Seq(TxOut((toLocal + toRemote).truncateToSatoshi, Funding.makeFundingPubKeyScript(localFundingPubKey, remoteFundingPubKey, DefaultCommitmentFormat))), 0)
520-
val commitmentInput = Transactions.InputInfo(OutPoint(fundingTx, 0), fundingTx.txOut.head, Scripts.multiSig2of2(localFundingPubKey, remoteFundingPubKey))
520+
val commitmentInput = Transactions.InputInfo.SegwitInput(OutPoint(fundingTx, 0), fundingTx.txOut.head, Scripts.multiSig2of2(localFundingPubKey, remoteFundingPubKey))
521521
val localCommit = LocalCommit(0, CommitmentSpec(Set.empty, FeeratePerKw(0 sat), toLocal, toRemote), CommitTxAndRemoteSig(CommitTx(commitmentInput, Transaction(2, Nil, Nil, 0)), ByteVector64.Zeroes), Nil)
522522
val remoteCommit = RemoteCommit(0, CommitmentSpec(Set.empty, FeeratePerKw(0 sat), toRemote, toLocal), randomTxId(), randomKey().publicKey)
523523
val localFundingStatus = announcement_opt match {

eclair-core/src/test/scala/fr/acinq/eclair/channel/HelpersSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class HelpersSpec extends TestKitBaseClass with AnyFunSuiteLike with ChannelStat
229229
)
230230

231231
def toClosingTx(txOut: Seq[TxOut]): ClosingTx = {
232-
ClosingTx(InputInfo(OutPoint(TxId(ByteVector32.Zeroes), 0), TxOut(1000 sat, Nil), Nil), Transaction(2, Nil, txOut, 0), None)
232+
ClosingTx(InputInfo.SegwitInput(OutPoint(TxId(ByteVector32.Zeroes), 0), TxOut(1000 sat, Nil), Nil), Transaction(2, Nil, txOut, 0), None)
233233
}
234234

235235
assert(Closing.MutualClose.checkClosingDustAmounts(toClosingTx(allOutputsAboveDust)))
@@ -249,7 +249,7 @@ class HelpersSpec extends TestKitBaseClass with AnyFunSuiteLike with ChannelStat
249249
Transaction.read("0200000001c8a8934fb38a44b969528252bc37be66ee166c7897c57384d1e561449e110c93010000006b483045022100dc6c50f445ed53d2fb41067fdcb25686fe79492d90e6e5db43235726ace247210220773d35228af0800c257970bee9cf75175d75217de09a8ecd83521befd040c4ca012102082b751372fe7e3b012534afe0bb8d1f2f09c724b1a10a813ce704e5b9c217ccfdffffff0247ba2300000000001976a914f97a7641228e6b17d4b0b08252ae75bd62a95fe788ace3de24000000000017a914a9fefd4b9a9282a1d7a17d2f14ac7d1eb88141d287f7d50800"),
250250
Transaction.read("010000000235a2f5c4fd48672534cce1ac063047edc38683f43c5a883f815d6026cb5f8321020000006a47304402206be5fd61b1702599acf51941560f0a1e1965aa086634b004967747f79788bd6e022002f7f719a45b8b5e89129c40a9d15e4a8ee1e33be3a891cf32e859823ecb7a510121024756c5adfbc0827478b0db042ce09d9b98e21ad80d036e73bd8e7f0ecbc254a2ffffffffb2387d3125bb8c84a2da83f4192385ce329283661dfc70191f4112c67ce7b4d0000000006b483045022100a2c737eab1c039f79238767ccb9bb3e81160e965ef0fc2ea79e8360c61b7c9f702202348b0f2c0ea2a757e25d375d9be183200ce0a79ec81d6a4ebb2ae4dc31bc3c9012102db16a822e2ec3706c58fc880c08a3617c61d8ef706cc8830cfe4561d9a5d52f0ffffffff01808d5b00000000001976a9141210c32def6b64d0d77ba8d99adeb7e9f91158b988ac00000000"),
251251
Transaction.read("0100000001b14ba6952c83f6f8c382befbf4e44270f13e479d5a5ff3862ac3a112f103ff2a010000006b4830450221008b097fd69bfa3715fc5e119a891933c091c55eabd3d1ddae63a1c2cc36dc9a3e02205666d5299fa403a393bcbbf4b05f9c0984480384796cdebcf69171674d00809c01210335b592484a59a44f40998d65a94f9e2eecca47e8d1799342112a59fc96252830ffffffff024bf308000000000017a914440668d018e5e0ba550d6e042abcf726694f515c8798dd1801000000001976a91453a503fe151dd32e0503bd9a2fbdbf4f9a3af1da88ac00000000")
252-
).map(tx => ClosingTx(InputInfo(tx.txIn.head.outPoint, TxOut(10_000 sat, Nil), Nil), tx, None))
252+
).map(tx => ClosingTx(InputInfo.SegwitInput(tx.txIn.head.outPoint, TxOut(10_000 sat, Nil), Nil), tx, None))
253253

254254
// only mutual close
255255
assert(Closing.isClosingTypeAlreadyKnown(

eclair-core/src/test/scala/fr/acinq/eclair/channel/InteractiveTxBuilderSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class InteractiveTxBuilderSpec extends TestKitBaseClass with AnyFunSuiteLike wit
106106
val fundingPubkeyScript: ByteVector = Script.write(Script.pay2wsh(Scripts.multiSig2of2(fundingParamsB.remoteFundingPubKey, fundingParamsA.remoteFundingPubKey)))
107107

108108
def dummySharedInputB(amount: Satoshi): SharedFundingInput = {
109-
val inputInfo = InputInfo(OutPoint(randomTxId(), 3), TxOut(amount, fundingPubkeyScript), Nil)
109+
val inputInfo = InputInfo.SegwitInput(OutPoint(randomTxId(), 3), TxOut(amount, fundingPubkeyScript), Nil)
110110
val fundingTxIndex = fundingParamsA.sharedInput_opt match {
111111
case Some(input: Multisig2of2Input) => input.fundingTxIndex + 1
112112
case _ => 0
@@ -2614,7 +2614,7 @@ class InteractiveTxBuilderSpec extends TestKitBaseClass with AnyFunSuiteLike wit
26142614
val params = createFixtureParams(100_000 sat, 0 sat, FeeratePerKw(5000 sat), 330 sat, 0)
26152615
val previousCommitment = CommitmentsSpec.makeCommitments(25_000_000 msat, 50_000_000 msat).active.head
26162616
val fundingTx = Transaction(2, Nil, Seq(TxOut(50_000 sat, Script.pay2wpkh(randomKey().publicKey)), TxOut(20_000 sat, Script.pay2wpkh(randomKey().publicKey))), 0)
2617-
val sharedInput = Multisig2of2Input(InputInfo(OutPoint(fundingTx, 0), fundingTx.txOut.head, Nil), 0, randomKey().publicKey)
2617+
val sharedInput = Multisig2of2Input(InputInfo.SegwitInput(OutPoint(fundingTx, 0), fundingTx.txOut.head, Nil), 0, randomKey().publicKey)
26182618
val bob = params.spawnTxBuilderSpliceBob(params.fundingParamsB.copy(sharedInput_opt = Some(sharedInput)), previousCommitment, wallet)
26192619
bob ! Start(probe.ref)
26202620
// Alice --- tx_add_input --> Bob

eclair-core/src/test/scala/fr/acinq/eclair/channel/publish/ReplaceableTxFunderSpec.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ReplaceableTxFunderSpec extends TestKitBaseClass with AnyFunSuiteLike {
4848
0
4949
)
5050
val anchorTx = ClaimLocalAnchorOutputTx(
51-
InputInfo(OutPoint(commitTx, 0), commitTx.txOut.head, anchorScript),
51+
InputInfo.SegwitInput(OutPoint(commitTx, 0), commitTx.txOut.head, anchorScript),
5252
Transaction(2, Seq(TxIn(OutPoint(commitTx, 0), ByteVector.empty, 0)), Nil, 0),
5353
ConfirmationTarget.Absolute(BlockHeight(0))
5454
)
@@ -67,14 +67,14 @@ class ReplaceableTxFunderSpec extends TestKitBaseClass with AnyFunSuiteLike {
6767
0
6868
)
6969
val htlcSuccess = HtlcSuccessWithWitnessData(HtlcSuccessTx(
70-
InputInfo(OutPoint(commitTx, 0), commitTx.txOut.head, htlcSuccessScript),
70+
InputInfo.SegwitInput(OutPoint(commitTx, 0), commitTx.txOut.head, htlcSuccessScript),
7171
Transaction(2, Seq(TxIn(OutPoint(commitTx, 0), ByteVector.empty, 0)), Seq(TxOut(5000 sat, Script.pay2wpkh(PlaceHolderPubKey))), 0),
7272
paymentHash,
7373
17,
7474
ConfirmationTarget.Absolute(BlockHeight(0))
7575
), PlaceHolderSig, preimage)
7676
val htlcTimeout = HtlcTimeoutWithWitnessData(HtlcTimeoutTx(
77-
InputInfo(OutPoint(commitTx, 1), commitTx.txOut.last, htlcTimeoutScript),
77+
InputInfo.SegwitInput(OutPoint(commitTx, 1), commitTx.txOut.last, htlcTimeoutScript),
7878
Transaction(2, Seq(TxIn(OutPoint(commitTx, 1), ByteVector.empty, 0)), Seq(TxOut(4000 sat, Script.pay2wpkh(PlaceHolderPubKey))), 0),
7979
12,
8080
ConfirmationTarget.Absolute(BlockHeight(0))
@@ -88,14 +88,14 @@ class ReplaceableTxFunderSpec extends TestKitBaseClass with AnyFunSuiteLike {
8888
val htlcSuccessScript = Scripts.htlcReceived(PlaceHolderPubKey, PlaceHolderPubKey, PlaceHolderPubKey, paymentHash, CltvExpiry(0), ZeroFeeHtlcTxAnchorOutputsCommitmentFormat)
8989
val htlcTimeoutScript = Scripts.htlcOffered(PlaceHolderPubKey, PlaceHolderPubKey, PlaceHolderPubKey, randomBytes32(), ZeroFeeHtlcTxAnchorOutputsCommitmentFormat)
9090
val claimHtlcSuccess = ClaimHtlcSuccessWithWitnessData(ClaimHtlcSuccessTx(
91-
InputInfo(OutPoint(TxId(ByteVector32.Zeroes), 3), TxOut(5000 sat, Script.pay2wsh(htlcSuccessScript)), htlcSuccessScript),
91+
InputInfo.SegwitInput(OutPoint(TxId(ByteVector32.Zeroes), 3), TxOut(5000 sat, Script.pay2wsh(htlcSuccessScript)), htlcSuccessScript),
9292
Transaction(2, Seq(TxIn(OutPoint(TxId(ByteVector32.Zeroes), 3), ByteVector.empty, 0)), Seq(TxOut(5000 sat, Script.pay2wpkh(PlaceHolderPubKey))), 0),
9393
paymentHash,
9494
5,
9595
ConfirmationTarget.Absolute(BlockHeight(0))
9696
), preimage)
9797
val claimHtlcTimeout = ClaimHtlcTimeoutWithWitnessData(ClaimHtlcTimeoutTx(
98-
InputInfo(OutPoint(TxId(ByteVector32.Zeroes), 7), TxOut(5000 sat, Script.pay2wsh(htlcTimeoutScript)), htlcTimeoutScript),
98+
InputInfo.SegwitInput(OutPoint(TxId(ByteVector32.Zeroes), 7), TxOut(5000 sat, Script.pay2wsh(htlcTimeoutScript)), htlcTimeoutScript),
9999
Transaction(2, Seq(TxIn(OutPoint(TxId(ByteVector32.Zeroes), 7), ByteVector.empty, 0)), Seq(TxOut(5000 sat, Script.pay2wpkh(PlaceHolderPubKey))), 0),
100100
7,
101101
ConfirmationTarget.Absolute(BlockHeight(0))

0 commit comments

Comments
 (0)