Skip to content

Commit ed27108

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 5f22a95 commit ed27108

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lnwallet/aux_signer.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ 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+
case NoopAdd:
125+
return true
126+
default:
127+
return false
128+
}
129+
}
130+
119131
// RemoveHeight returns the height at which the HTLC was removed from the
120132
// commitment chain. The height is returned based on the chain the HTLC is being
121133
// removed from (local or remote chain).

0 commit comments

Comments
 (0)