lnwallet: add IsAdd helper to AuxHtlcDescriptor
What changed, and why it matters
This commit adds a small helper method called IsAdd to a data structure in LND's wallet code. It simply tells callers whether an HTLC (a payment channel transaction) is an 'add' type. There is no security issue visible in the change itself.
No security action required. Review as normal code-quality change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces an IsAdd() bool method on AuxHtlcDescriptor in lnwallet/aux_signer.go. The method returns true when the descriptor’s EntryType is Add or NoOpAdd, and false otherwise. It is a read-only accessor with no side effects, no input parsing, no cryptographic operations, and no state mutation beyond the method definition.
Changed components
lnwallet/aux_signer.goInspect captured patch +12 / −0
diff --git a/lnwallet/aux_signer.go b/lnwallet/aux_signer.go
index 90a4325..042d322 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).
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.