From c9d8e41e340504390f34724ac769474c6558541c Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Tue, 27 May 2025 13:22:52 +0200 Subject: [PATCH] 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. --- lnwallet/aux_signer.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lnwallet/aux_signer.go b/lnwallet/aux_signer.go index 90a4325f6..042d3223e 100644 --- a/lnwallet/aux_signer.go +++ b/lnwallet/aux_signer.go @@ -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).