File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,24 @@ func NoneTapLeaf() AuxTapLeaf {
3131 return fn .None [txscript.TapLeaf ]()
3232}
3333
34+ // HtlcIndex represents the monotonically increasing counter that is used to
35+ // identify HTLCs created a peer.
36+ type HtlcIndex = uint64
37+
38+ // HtlcAuxLeaf is a type that represents an auxiliary leaf for an HTLC output.
39+ // An HTLC may have up to two aux leaves: one for the output on the commitment
40+ // transaction, and one for the second level HTLC.
41+ type HtlcAuxLeaf struct {
42+ AuxTapLeaf
43+
44+ // SecondLevelLeaf is the auxiliary leaf for the second level HTLC
45+ // success or timeout transaction.
46+ SecondLevelLeaf AuxTapLeaf
47+ }
48+
49+ // AuxTapLeaves is a type alias for a slice of optional tapscript leaves.
50+ type AuxTapLeaves = map [HtlcIndex ]HtlcAuxLeaf
51+
3452// NewTxSigHashesV0Only returns a new txscript.TxSigHashes instance that will
3553// only calculate the sighash midstate values for segwit v0 inputs and can
3654// therefore never be used for transactions that want to spend segwit v1
You can’t perform that action at this time.
0 commit comments