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.
This commit is contained in:
George Tsagkarelis
2025-05-27 13:22:52 +02:00
committed by Oliver Gugger
parent 53554cd438
commit c9d8e41e34

View File

@@ -116,6 +116,18 @@ func (a *AuxHtlcDescriptor) AddHeight(
return a.addCommitHeightLocal
}
// IsAdd checks if the entry type of the Aux HTLC Descriptor is an add type.
func (a *AuxHtlcDescriptor) IsAdd() bool {
switch a.EntryType {
case Add:
fallthrough
case NoOpAdd:
return true
default:
return false
}
}
// RemoveHeight returns the height at which the HTLC was removed from the
// commitment chain. The height is returned based on the chain the HTLC is being
// removed from (local or remote chain).