• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 11219354629

07 Oct 2024 03:56PM UTC coverage: 58.585% (-0.2%) from 58.814%
11219354629

Pull #9147

github

ziggie1984
fixup! sqlc: migration up script for payments.
Pull Request #9147: [Part 1|3] Introduce SQL Payment schema into LND

130227 of 222287 relevant lines covered (58.59%)

29106.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.6
/input/input.go
1
package input
2

3
import (
4
        "fmt"
5

6
        "github.com/btcsuite/btcd/btcutil"
7
        "github.com/btcsuite/btcd/txscript"
8
        "github.com/btcsuite/btcd/wire"
9
        "github.com/lightningnetwork/lnd/lntypes"
10
)
11

12
// EmptyOutPoint is a zeroed outpoint.
13
var EmptyOutPoint wire.OutPoint
14

15
// Input represents an abstract UTXO which is to be spent using a sweeping
16
// transaction. The method provided give the caller all information needed to
17
// construct a valid input within a sweeping transaction to sweep this
18
// lingering UTXO.
19
type Input interface {
20
        // Outpoint returns the reference to the output being spent, used to
21
        // construct the corresponding transaction input.
22
        OutPoint() wire.OutPoint
23

24
        // RequiredTxOut returns a non-nil TxOut if input commits to a certain
25
        // transaction output. This is used in the SINGLE|ANYONECANPAY case to
26
        // make sure any presigned input is still valid by including the
27
        // output.
28
        RequiredTxOut() *wire.TxOut
29

30
        // RequiredLockTime returns whether this input commits to a tx locktime
31
        // that must be used in the transaction including it.
32
        RequiredLockTime() (uint32, bool)
33

34
        // WitnessType returns an enum specifying the type of witness that must
35
        // be generated in order to spend this output.
36
        WitnessType() WitnessType
37

38
        // SignDesc returns a reference to a spendable output's sign
39
        // descriptor, which is used during signing to compute a valid witness
40
        // that spends this output.
41
        SignDesc() *SignDescriptor
42

43
        // CraftInputScript returns a valid set of input scripts allowing this
44
        // output to be spent. The returns input scripts should target the
45
        // input at location txIndex within the passed transaction. The input
46
        // scripts generated by this method support spending p2wkh, p2wsh, and
47
        // also nested p2sh outputs.
48
        CraftInputScript(signer Signer, txn *wire.MsgTx,
49
                hashCache *txscript.TxSigHashes,
50
                prevOutputFetcher txscript.PrevOutputFetcher,
51
                txinIdx int) (*Script, error)
52

53
        // BlocksToMaturity returns the relative timelock, as a number of
54
        // blocks, that must be built on top of the confirmation height before
55
        // the output can be spent. For non-CSV locked inputs this is always
56
        // zero.
57
        BlocksToMaturity() uint32
58

59
        // HeightHint returns the minimum height at which a confirmed spending
60
        // tx can occur.
61
        HeightHint() uint32
62

63
        // UnconfParent returns information about a possibly unconfirmed parent
64
        // tx.
65
        UnconfParent() *TxInfo
66
}
67

68
// TxInfo describes properties of a parent tx that are relevant for CPFP.
69
type TxInfo struct {
70
        // Fee is the fee of the tx.
71
        Fee btcutil.Amount
72

73
        // Weight is the weight of the tx.
74
        Weight lntypes.WeightUnit
75
}
76

77
// String returns a human readable version of the tx info.
78
func (t *TxInfo) String() string {
79
        return fmt.Sprintf("fee=%v, weight=%v", t.Fee, t.Weight)
80
}
81

82
// SignDetails is a struct containing information needed to resign certain
83
// inputs. It is used to re-sign 2nd level HTLC transactions that uses the
84
// SINGLE|ANYONECANPAY sighash type, as we have a signature provided by our
2✔
85
// peer, but we can aggregate multiple of these 2nd level transactions into a
2✔
86
// new transaction, that needs to be signed by us.
2✔
87
type SignDetails struct {
88
        // SignDesc is the sign descriptor needed for us to sign the input.
89
        SignDesc SignDescriptor
90

91
        // PeerSig is the peer's signature for this input.
92
        PeerSig Signature
93

94
        // SigHashType is the sighash signed by the peer.
95
        SigHashType txscript.SigHashType
96
}
97

98
type inputKit struct {
99
        outpoint        wire.OutPoint
100
        witnessType     WitnessType
101
        signDesc        SignDescriptor
102
        heightHint      uint32
103
        blockToMaturity uint32
104
        cltvExpiry      uint32
105

106
        // unconfParent contains information about a potential unconfirmed
107
        // parent transaction.
108
        unconfParent *TxInfo
109
}
110

111
// OutPoint returns the breached output's identifier that is to be included as
112
// a transaction input.
113
func (i *inputKit) OutPoint() wire.OutPoint {
114
        return i.outpoint
115
}
116

117
// RequiredTxOut returns a nil for the base input type.
118
func (i *inputKit) RequiredTxOut() *wire.TxOut {
119
        return nil
120
}
121

122
// RequiredLockTime returns whether this input commits to a tx locktime that
123
// must be used in the transaction including it. This will be false for the
2,916✔
124
// base input type since we can re-sign for any lock time.
2,916✔
125
func (i *inputKit) RequiredLockTime() (uint32, bool) {
2,916✔
126
        return i.cltvExpiry, i.cltvExpiry > 0
127
}
128

136✔
129
// WitnessType returns the type of witness that must be generated to spend the
136✔
130
// breached output.
136✔
131
func (i *inputKit) WitnessType() WitnessType {
132
        return i.witnessType
133
}
134

135
// SignDesc returns the breached output's SignDescriptor, which is used during
27✔
136
// signing to compute the witness.
27✔
137
func (i *inputKit) SignDesc() *SignDescriptor {
27✔
138
        return &i.signDesc
139
}
140

141
// HeightHint returns the minimum height at which a confirmed spending
1,523✔
142
// tx can occur.
1,523✔
143
func (i *inputKit) HeightHint() uint32 {
1,523✔
144
        return i.heightHint
145
}
146

147
// BlocksToMaturity returns the relative timelock, as a number of blocks, that
2,880✔
148
// must be built on top of the confirmation height before the output can be
2,880✔
149
// spent. For non-CSV locked inputs this is always zero.
2,880✔
150
func (i *inputKit) BlocksToMaturity() uint32 {
151
        return i.blockToMaturity
152
}
153

2✔
154
// Cpfp returns information about a possibly unconfirmed parent tx.
2✔
155
func (i *inputKit) UnconfParent() *TxInfo {
2✔
156
        return i.unconfParent
157
}
158

159
// BaseInput contains all the information needed to sweep a basic
160
// output (CSV/CLTV/no time lock).
1,418✔
161
type BaseInput struct {
1,418✔
162
        inputKit
1,418✔
163
}
164

165
// MakeBaseInput assembles a new BaseInput that can be used to construct a
64✔
166
// sweep transaction.
64✔
167
func MakeBaseInput(outpoint *wire.OutPoint, witnessType WitnessType,
64✔
168
        signDescriptor *SignDescriptor, heightHint uint32,
169
        unconfParent *TxInfo) BaseInput {
170

171
        return BaseInput{
9✔
172
                inputKit{
9✔
173
                        outpoint:     *outpoint,
9✔
174
                        witnessType:  witnessType,
175
                        signDesc:     *signDescriptor,
176
                        heightHint:   heightHint,
177
                        unconfParent: unconfParent,
178
                },
179
        }
180
}
181

182
// NewBaseInput allocates and assembles a new *BaseInput that can be used to
183
// construct a sweep transaction.
1,124✔
184
func NewBaseInput(outpoint *wire.OutPoint, witnessType WitnessType,
1,124✔
185
        signDescriptor *SignDescriptor, heightHint uint32) *BaseInput {
1,124✔
186

187
        input := MakeBaseInput(
188
                outpoint, witnessType, signDescriptor, heightHint, nil,
189
        )
190

191
        return &input
192
}
193

5✔
194
// NewCsvInput assembles a new csv-locked input that can be used to
10✔
195
// construct a sweep transaction.
5✔
196
func NewCsvInput(outpoint *wire.OutPoint, witnessType WitnessType,
5✔
197
        signDescriptor *SignDescriptor, heightHint uint32,
198
        blockToMaturity uint32) *BaseInput {
199

200
        return &BaseInput{
201
                inputKit{
202
                        outpoint:        *outpoint,
203
                        witnessType:     witnessType,
204
                        signDesc:        *signDescriptor,
205
                        heightHint:      heightHint,
206
                        blockToMaturity: blockToMaturity,
207
                },
208
        }
209
}
1,124✔
210

1,124✔
211
// NewCsvInputWithCltv assembles a new csv and cltv locked input that can be
1,124✔
212
// used to construct a sweep transaction.
1,129✔
213
func NewCsvInputWithCltv(outpoint *wire.OutPoint, witnessType WitnessType,
5✔
214
        signDescriptor *SignDescriptor, heightHint uint32,
5✔
215
        csvDelay uint32, cltvExpiry uint32) *BaseInput {
216

1,124✔
217
        return &BaseInput{
1,124✔
218
                inputKit{
1,124✔
219
                        outpoint:        *outpoint,
1,124✔
220
                        witnessType:     witnessType,
1,124✔
221
                        signDesc:        *signDescriptor,
1,124✔
222
                        heightHint:      heightHint,
1,124✔
223
                        blockToMaturity: csvDelay,
1,124✔
224
                        cltvExpiry:      cltvExpiry,
1,124✔
225
                        unconfParent:    nil,
1,124✔
226
                },
227
        }
228
}
229

230
// CraftInputScript returns a valid set of input scripts allowing this output
231
// to be spent. The returned input scripts should target the input at location
232
// txIndex within the passed transaction. The input scripts generated by this
569✔
233
// method support spending p2wkh, p2wsh, and also nested p2sh outputs.
569✔
234
func (bi *BaseInput) CraftInputScript(signer Signer, txn *wire.MsgTx,
569✔
235
        hashCache *txscript.TxSigHashes,
569✔
236
        prevOutputFetcher txscript.PrevOutputFetcher, txinIdx int) (*Script,
569✔
237
        error) {
569✔
238

569✔
239
        signDesc := bi.SignDesc()
569✔
240
        signDesc.PrevOutputFetcher = prevOutputFetcher
241
        witnessFunc := bi.witnessType.WitnessGenerator(signer, signDesc)
242

243
        return witnessFunc(txn, hashCache, txinIdx)
244
}
245

512✔
246
// HtlcSucceedInput constitutes a sweep input that needs a pre-image. The input
512✔
247
// is expected to reside on the commitment tx of the remote party and should
512✔
248
// not be a second level tx output.
512✔
249
type HtlcSucceedInput struct {
512✔
250
        inputKit
512✔
251

512✔
252
        preimage []byte
512✔
253
}
512✔
254

512✔
255
// MakeHtlcSucceedInput assembles a new redeem input that can be used to
256
// construct a sweep transaction.
257
func MakeHtlcSucceedInput(outpoint *wire.OutPoint,
258
        signDescriptor *SignDescriptor, preimage []byte, heightHint,
259
        blocksToMaturity uint32) HtlcSucceedInput {
260

6✔
261
        return HtlcSucceedInput{
6✔
262
                inputKit: inputKit{
6✔
263
                        outpoint:        *outpoint,
6✔
264
                        witnessType:     HtlcAcceptedRemoteSuccess,
6✔
265
                        signDesc:        *signDescriptor,
6✔
266
                        heightHint:      heightHint,
6✔
267
                        blockToMaturity: blocksToMaturity,
6✔
268
                },
6✔
269
                preimage: preimage,
6✔
270
        }
6✔
271
}
272

273
// MakeTaprootHtlcSucceedInput creates a new HtlcSucceedInput that can be used
274
// to spend an HTLC output for a taproot channel on the remote party's
275
// commitment transaction.
276
func MakeTaprootHtlcSucceedInput(op *wire.OutPoint, signDesc *SignDescriptor,
277
        preimage []byte, heightHint, blocksToMaturity uint32) HtlcSucceedInput {
278

279
        return HtlcSucceedInput{
1,418✔
280
                inputKit: inputKit{
1,418✔
281
                        outpoint:        *op,
1,418✔
282
                        witnessType:     TaprootHtlcAcceptedRemoteSuccess,
1,418✔
283
                        signDesc:        *signDesc,
1,418✔
284
                        heightHint:      heightHint,
1,418✔
285
                        blockToMaturity: blocksToMaturity,
1,418✔
286
                },
1,418✔
287
                preimage: preimage,
288
        }
289
}
290

291
// CraftInputScript returns a valid set of input scripts allowing this output
292
// to be spent. The returns input scripts should target the input at location
293
// txIndex within the passed transaction. The input scripts generated by this
294
// method support spending p2wkh, p2wsh, and also nested p2sh outputs.
295
func (h *HtlcSucceedInput) CraftInputScript(signer Signer, txn *wire.MsgTx,
296
        hashCache *txscript.TxSigHashes,
297
        prevOutputFetcher txscript.PrevOutputFetcher, txinIdx int) (*Script,
298
        error) {
299

300
        desc := h.signDesc
301
        desc.SigHashes = hashCache
3✔
302
        desc.InputIndex = txinIdx
3✔
303
        desc.PrevOutputFetcher = prevOutputFetcher
3✔
304

3✔
305
        isTaproot := txscript.IsPayToTaproot(desc.Output.PkScript)
3✔
306

3✔
307
        var (
3✔
308
                witness wire.TxWitness
3✔
309
                err     error
3✔
310
        )
3✔
311
        if isTaproot {
3✔
312
                if desc.ControlBlock == nil {
3✔
313
                        return nil, fmt.Errorf("ctrl block must be set")
3✔
314
                }
315

316
                desc.SignMethod = TaprootScriptSpendSignMethod
317

318
                witness, err = SenderHTLCScriptTaprootRedeem(
319
                        signer, &desc, txn, h.preimage, nil, nil,
320
                )
2✔
321
        } else {
2✔
322
                witness, err = SenderHtlcSpendRedeem(
2✔
323
                        signer, &desc, txn, h.preimage,
2✔
324
                )
2✔
325
        }
2✔
326
        if err != nil {
2✔
327
                return nil, err
2✔
328
        }
2✔
329

2✔
330
        return &Script{
2✔
331
                Witness: witness,
2✔
332
        }, nil
2✔
333
}
334

335
// HtlcSecondLevelAnchorInput is an input type used to spend HTLC outputs
336
// using a re-signed second level transaction, either via the timeout or success
337
// paths.
338
type HtlcSecondLevelAnchorInput struct {
339
        inputKit
340

341
        // SignedTx is the original second level transaction signed by the
2✔
342
        // channel peer.
2✔
343
        SignedTx *wire.MsgTx
2✔
344

2✔
345
        // createWitness creates a witness allowing the passed transaction to
2✔
346
        // spend the input.
2✔
347
        createWitness func(signer Signer, txn *wire.MsgTx,
2✔
348
                hashCache *txscript.TxSigHashes,
2✔
349
                prevOutputFetcher txscript.PrevOutputFetcher,
2✔
350
                txinIdx int) (wire.TxWitness, error)
2✔
351
}
2✔
352

2✔
353
// RequiredTxOut returns the tx out needed to be present on the sweep tx for
2✔
354
// the spend of the input to be valid.
4✔
355
func (i *HtlcSecondLevelAnchorInput) RequiredTxOut() *wire.TxOut {
2✔
356
        return i.SignedTx.TxOut[0]
×
357
}
×
358

359
// RequiredLockTime returns the locktime needed for the sweep tx for the spend
2✔
360
// of the input to be valid. For a second level HTLC timeout this will be the
2✔
361
// CLTV expiry, for HTLC success it will be zero.
2✔
362
func (i *HtlcSecondLevelAnchorInput) RequiredLockTime() (uint32, bool) {
2✔
363
        return i.SignedTx.LockTime, true
2✔
364
}
2✔
365

2✔
366
// CraftInputScript returns a valid set of input scripts allowing this output
2✔
367
// to be spent. The returns input scripts should target the input at location
2✔
368
// txIndex within the passed transaction. The input scripts generated by this
2✔
369
// method support spending p2wkh, p2wsh, and also nested p2sh outputs.
2✔
370
func (i *HtlcSecondLevelAnchorInput) CraftInputScript(signer Signer,
×
371
        txn *wire.MsgTx, hashCache *txscript.TxSigHashes,
×
372
        prevOutputFetcher txscript.PrevOutputFetcher, txinIdx int) (*Script,
373
        error) {
2✔
374

2✔
375
        witness, err := i.createWitness(
2✔
376
                signer, txn, hashCache, prevOutputFetcher, txinIdx,
377
        )
378
        if err != nil {
379
                return nil, err
380
        }
381

382
        return &Script{
383
                Witness: witness,
384
        }, nil
385
}
386

387
// MakeHtlcSecondLevelTimeoutAnchorInput creates an input allowing the sweeper
388
// to spend the HTLC output on our commit using the second level timeout
389
// transaction.
390
func MakeHtlcSecondLevelTimeoutAnchorInput(signedTx *wire.MsgTx,
391
        signDetails *SignDetails, heightHint uint32) HtlcSecondLevelAnchorInput {
392

393
        // Spend an HTLC output on our local commitment tx using the
394
        // 2nd timeout transaction.
395
        createWitness := func(signer Signer, txn *wire.MsgTx,
396
                hashCache *txscript.TxSigHashes,
397
                prevOutputFetcher txscript.PrevOutputFetcher,
398
                txinIdx int) (wire.TxWitness, error) {
2✔
399

2✔
400
                desc := signDetails.SignDesc
2✔
401
                desc.SigHashes = txscript.NewTxSigHashes(txn, prevOutputFetcher)
402
                desc.InputIndex = txinIdx
403
                desc.PrevOutputFetcher = prevOutputFetcher
404

405
                return SenderHtlcSpendTimeout(
2✔
406
                        signDetails.PeerSig, signDetails.SigHashType, signer,
2✔
407
                        &desc, txn,
2✔
408
                )
409
        }
410

411
        return HtlcSecondLevelAnchorInput{
412
                inputKit: inputKit{
413
                        outpoint:    signedTx.TxIn[0].PreviousOutPoint,
414
                        witnessType: HtlcOfferedTimeoutSecondLevelInputConfirmed,
415
                        signDesc:    signDetails.SignDesc,
416
                        heightHint:  heightHint,
2✔
417

2✔
418
                        // CSV delay is always 1 for these inputs.
2✔
419
                        blockToMaturity: 1,
2✔
420
                },
2✔
421
                SignedTx:      signedTx,
2✔
422
                createWitness: createWitness,
×
423
        }
×
424
}
425

2✔
426
// MakeHtlcSecondLevelTimeoutTaprootInput creates an input that allows the
2✔
427
// sweeper to spend an HTLC output to the second level on our commitment
2✔
428
// transaction. The sweeper is also able to generate witnesses on demand to
429
// sweep the second level HTLC aggregated with other transactions.
430
func MakeHtlcSecondLevelTimeoutTaprootInput(signedTx *wire.MsgTx,
431
        signDetails *SignDetails,
432
        heightHint uint32) HtlcSecondLevelAnchorInput {
433

434
        createWitness := func(signer Signer, txn *wire.MsgTx,
435
                hashCache *txscript.TxSigHashes,
4✔
436
                prevOutputFetcher txscript.PrevOutputFetcher,
4✔
437
                txinIdx int) (wire.TxWitness, error) {
4✔
438

4✔
439
                desc := signDetails.SignDesc
4✔
440
                if desc.ControlBlock == nil {
4✔
441
                        return nil, fmt.Errorf("ctrl block must be set")
4✔
442
                }
6✔
443

2✔
444
                desc.SigHashes = txscript.NewTxSigHashes(txn, prevOutputFetcher)
2✔
445
                desc.InputIndex = txinIdx
2✔
446
                desc.PrevOutputFetcher = prevOutputFetcher
2✔
447

2✔
448
                desc.SignMethod = TaprootScriptSpendSignMethod
2✔
449

2✔
450
                return SenderHTLCScriptTaprootTimeout(
2✔
451
                        signDetails.PeerSig, signDetails.SigHashType, signer,
2✔
452
                        &desc, txn, nil, nil,
2✔
453
                )
2✔
454
        }
455

4✔
456
        return HtlcSecondLevelAnchorInput{
4✔
457
                inputKit: inputKit{
4✔
458
                        outpoint:    signedTx.TxIn[0].PreviousOutPoint,
4✔
459
                        witnessType: TaprootHtlcLocalOfferedTimeout,
4✔
460
                        signDesc:    signDetails.SignDesc,
4✔
461
                        heightHint:  heightHint,
4✔
462

4✔
463
                        // CSV delay is always 1 for these inputs.
4✔
464
                        blockToMaturity: 1,
4✔
465
                },
4✔
466
                SignedTx:      signedTx,
4✔
467
                createWitness: createWitness,
468
        }
469
}
470

471
// MakeHtlcSecondLevelSuccessAnchorInput creates an input allowing the sweeper
472
// to spend the HTLC output on our commit using the second level success
473
// transaction.
474
func MakeHtlcSecondLevelSuccessAnchorInput(signedTx *wire.MsgTx,
475
        signDetails *SignDetails, preimage lntypes.Preimage,
2✔
476
        heightHint uint32) HtlcSecondLevelAnchorInput {
2✔
477

2✔
478
        // Spend an HTLC output on our local commitment tx using the 2nd
2✔
479
        // success transaction.
2✔
480
        createWitness := func(signer Signer, txn *wire.MsgTx,
4✔
481
                hashCache *txscript.TxSigHashes,
2✔
482
                prevOutputFetcher txscript.PrevOutputFetcher,
2✔
483
                txinIdx int) (wire.TxWitness, error) {
2✔
484

×
485
                desc := signDetails.SignDesc
×
486
                desc.SigHashes = hashCache
487
                desc.InputIndex = txinIdx
2✔
488
                desc.PrevOutputFetcher = prevOutputFetcher
2✔
489

2✔
490
                return ReceiverHtlcSpendRedeem(
2✔
491
                        signDetails.PeerSig, signDetails.SigHashType,
2✔
492
                        preimage[:], signer, &desc, txn,
2✔
493
                )
2✔
494
        }
2✔
495

2✔
496
        return HtlcSecondLevelAnchorInput{
2✔
497
                inputKit: inputKit{
498
                        outpoint:    signedTx.TxIn[0].PreviousOutPoint,
499
                        witnessType: HtlcAcceptedSuccessSecondLevelInputConfirmed,
2✔
500
                        signDesc:    signDetails.SignDesc,
2✔
501
                        heightHint:  heightHint,
2✔
502

2✔
503
                        // CSV delay is always 1 for these inputs.
2✔
504
                        blockToMaturity: 1,
2✔
505
                },
2✔
506
                SignedTx:      signedTx,
2✔
507
                createWitness: createWitness,
2✔
508
        }
2✔
509
}
2✔
510

2✔
511
// MakeHtlcSecondLevelSuccessTaprootInput creates an input that allows the
512
// sweeper to spend an HTLC output to the second level on our taproot
513
// commitment transaction.
514
func MakeHtlcSecondLevelSuccessTaprootInput(signedTx *wire.MsgTx,
515
        signDetails *SignDetails, preimage lntypes.Preimage,
516
        heightHint uint32) HtlcSecondLevelAnchorInput {
517

518
        createWitness := func(signer Signer, txn *wire.MsgTx,
3✔
519
                hashCache *txscript.TxSigHashes,
3✔
520
                prevOutputFetcher txscript.PrevOutputFetcher,
3✔
521
                txinIdx int) (wire.TxWitness, error) {
3✔
522

3✔
523
                desc := signDetails.SignDesc
3✔
524
                if desc.ControlBlock == nil {
3✔
525
                        return nil, fmt.Errorf("ctrl block must be set")
5✔
526
                }
2✔
527

2✔
528
                desc.SigHashes = txscript.NewTxSigHashes(txn, prevOutputFetcher)
2✔
529
                desc.InputIndex = txinIdx
2✔
530
                desc.PrevOutputFetcher = prevOutputFetcher
2✔
531

2✔
532
                desc.SignMethod = TaprootScriptSpendSignMethod
2✔
533

2✔
534
                return ReceiverHTLCScriptTaprootRedeem(
2✔
535
                        signDetails.PeerSig, signDetails.SigHashType,
2✔
536
                        preimage[:], signer, &desc, txn, nil, nil,
2✔
537
                )
3✔
538
        }
3✔
539

3✔
540
        return HtlcSecondLevelAnchorInput{
3✔
541
                inputKit: inputKit{
3✔
542
                        outpoint:    signedTx.TxIn[0].PreviousOutPoint,
3✔
543
                        witnessType: TaprootHtlcAcceptedLocalSuccess,
3✔
544
                        signDesc:    signDetails.SignDesc,
3✔
545
                        heightHint:  heightHint,
3✔
546

3✔
547
                        // CSV delay is always 1 for these inputs.
3✔
548
                        blockToMaturity: 1,
3✔
549
                },
550
                SignedTx:      signedTx,
551
                createWitness: createWitness,
552
        }
553
}
554

555
// Compile-time constraints to ensure each input struct implement the Input
556
// interface.
2✔
557
var _ Input = (*BaseInput)(nil)
2✔
558
var _ Input = (*HtlcSucceedInput)(nil)
2✔
559
var _ Input = (*HtlcSecondLevelAnchorInput)(nil)
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc