@@ -10,9 +10,20 @@ import (
10
10
"github.com/lightningnetwork/lnd/tlv"
11
11
)
12
12
13
- // htlcCustomSigType is the TLV type that is used to encode the custom HTLC
14
- // signatures within the custom data for an existing HTLC.
15
- var htlcCustomSigType tlv.TlvType65543
13
+ var (
14
+ // htlcCustomSigType is the TLV type that is used to encode the custom
15
+ // HTLC signatures within the custom data for an existing HTLC.
16
+ htlcCustomSigType tlv.TlvType65543
17
+
18
+ // NoOpHtlcTLVEntry is the TLV that that's used in the update_add_htlc
19
+ // message to indicate the presence of a noop HTLC. This has no encoded
20
+ // value, its presence is used to indicate that the HTLC is a noop.
21
+ NoOpHtlcTLVEntry tlv.TlvType65544
22
+ )
23
+
24
+ // NoOpHtlcTLVType is the (golang) type of the TLV record that's used to signal
25
+ // that an HTLC should be a noop HTLC.
26
+ type NoOpHtlcTLVType = tlv.TlvType65544
16
27
17
28
// AuxHtlcView is a struct that contains a safe copy of an HTLC view that can
18
29
// be used by aux components.
@@ -116,6 +127,18 @@ func (a *AuxHtlcDescriptor) AddHeight(
116
127
return a .addCommitHeightLocal
117
128
}
118
129
130
+ // IsAdd checks if the entry type of the Aux HTLC Descriptor is an add type.
131
+ func (a * AuxHtlcDescriptor ) IsAdd () bool {
132
+ switch a .EntryType {
133
+ case Add :
134
+ fallthrough
135
+ case NoOpAdd :
136
+ return true
137
+ default :
138
+ return false
139
+ }
140
+ }
141
+
119
142
// RemoveHeight returns the height at which the HTLC was removed from the
120
143
// commitment chain. The height is returned based on the chain the HTLC is being
121
144
// removed from (local or remote chain).
0 commit comments