Skip to content

Commit 51a6064

Browse files
committed
lnwallet: add IsAdd helper to AuxHtlcDescriptor
We also add the IsAdd helper to the AuxHtlcDescriptor, as external software using the aux framework might want to know which type of HTLC this is.
1 parent 8bb09b7 commit 51a6064

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lnwallet/aux_signer.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@ func (a *AuxHtlcDescriptor) AddHeight(
116116
return a.addCommitHeightLocal
117117
}
118118

119+
// IsAdd checks if the entry type of the Aux HTLC Descriptor is an add type.
120+
func (a *AuxHtlcDescriptor) IsAdd() bool {
121+
switch a.EntryType {
122+
case Add:
123+
fallthrough
124+
125+
case NoopAdd:
126+
return true
127+
128+
default:
129+
return false
130+
}
131+
}
132+
119133
// RemoveHeight returns the height at which the HTLC was removed from the
120134
// commitment chain. The height is returned based on the chain the HTLC is being
121135
// removed from (local or remote chain).

0 commit comments

Comments
 (0)