mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 14:40:30 +01:00
input: add some utility type definitions for aux leaves
In this commit, we add some useful type definitions for the aux leaf.
This commit is contained in:
parent
12acbac16a
commit
fc44ff4bff
1 changed files with 18 additions and 0 deletions
|
@ -31,6 +31,24 @@ func NoneTapLeaf() AuxTapLeaf {
|
|||
return fn.None[txscript.TapLeaf]()
|
||||
}
|
||||
|
||||
// HtlcIndex represents the monotonically increasing counter that is used to
|
||||
// identify HTLCs created a peer.
|
||||
type HtlcIndex = uint64
|
||||
|
||||
// HtlcAuxLeaf is a type that represents an auxiliary leaf for an HTLC output.
|
||||
// An HTLC may have up to two aux leaves: one for the output on the commitment
|
||||
// transaction, and one for the second level HTLC.
|
||||
type HtlcAuxLeaf struct {
|
||||
AuxTapLeaf
|
||||
|
||||
// SecondLevelLeaf is the auxiliary leaf for the second level HTLC
|
||||
// success or timeout transaction.
|
||||
SecondLevelLeaf AuxTapLeaf
|
||||
}
|
||||
|
||||
// AuxTapLeaves is a type alias for a slice of optional tapscript leaves.
|
||||
type AuxTapLeaves = map[HtlcIndex]HtlcAuxLeaf
|
||||
|
||||
// NewTxSigHashesV0Only returns a new txscript.TxSigHashes instance that will
|
||||
// only calculate the sighash midstate values for segwit v0 inputs and can
|
||||
// therefore never be used for transactions that want to spend segwit v1
|
||||
|
|
Loading…
Add table
Reference in a new issue