Skip to content

chore: remove dead EXPIRY_HTLC constant from keys#178

Open
andrerfneves wants to merge 1 commit into
mainfrom
maintenance/remove-dead-expiry-htlc-20260613
Open

chore: remove dead EXPIRY_HTLC constant from keys#178
andrerfneves wants to merge 1 commit into
mainfrom
maintenance/remove-dead-expiry-htlc-20260613

Conversation

@andrerfneves

Copy link
Copy Markdown
Owner

Summary

Removes the dead EXPIRY_HTLC constant ('expiry_htlc') from src/constants/keys.js, along with its switch case in src/utils/keys.js and the corresponding test case in keys.test.js.

Why

The key 'expiry_htlc' never appears in any decoded Lightning data output:

  • BOLT11 tag code 24 maps to min_final_cltv_expiry, not expiry_htlc
  • BOLT12, LNURL, and Lightning Address data do not produce this key either

This constant was misleading — developers looking at the constants file might expect expiry_htlc to appear in decoded invoices, but it never does.

Changes

  • src/constants/keys.js: Removed EXPIRY_HTLC = 'expiry_htlc' export
  • src/utils/keys.js: Removed EXPIRY_HTLC import and its case in formatDetailsKey
  • src/utils/keys.test.js: Removed the expiry_htlc test case from formatDetailsKey tests

Test Plan

  • All 52 existing tests pass unchanged
  • No behavior change — the removed code path was never reached

The EXPIRY_HTLC constant ('expiry_htlc') was defined, exported, and had a
switch case in formatDetailsKey, but this key never appears in any decoded
Lightning data output. BOLT11 tag code 24 correctly maps to
'min_final_cltv_expiry'.

Removing this dead constant reduces confusion for developers who might
otherwise look for 'expiry_htlc' in decoded invoice data.
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lightning-decoder Ready Ready Preview, Comment Jun 13, 2026 6:05pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant