Skip to content

fix(lnd): patch subscribe_to_channels for LND v0.21.2+ compatibility - #777

Open
mutatrum wants to merge 1 commit into
apotdevin:masterfrom
mutatrum:fix/lnd-channel-subscription
Open

mutatrum wants to merge 1 commit into
apotdevin:masterfrom
mutatrum:fix/lnd-channel-subscription

Conversation

@mutatrum

Copy link
Copy Markdown
Contributor

Problem

When connected to LND nodes running v0.21.2+, subscribe_to_channels in the lightning package can receive subscription update events where update.type is undefined or missing, or details for the event type are omitted.

Currently, this causes subscribe_to_channels to emit fatal errors:

  • ExpectedEventTypeInChannelSubscription
  • ExpectedEventDetailsForTypeInChannelSub

These unhandled errors crash the channel subscription listener service in ThunderHub.

Solution

Add patches/lightning+11.1.0.patch (applied automatically via existing patch-package on postinstall):

  1. Detect the update type from available event properties (updateActive, updateInactive, updateClosed, updateOpened, updateOpening) if update.type is not explicitly populated.
  2. Gracefully ignore unhandled / details-less updates rather than emitting fatal unhandled stream errors that crash the process.

Verification

  • Verified patch-package cleanly applies lightning@11.1.0.
  • All Jest test suites pass.
  • Verified stable channel subscription stream with LND v0.21.2+.

@mutatrum

mutatrum commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Updating to lightning@12 will not completely fix this, there the unknown types will be dropped (see alexbosworth/lightning@92dd949#diff-f37c0d4a072ce95eb1d7607b3234c7a0c25f6a43ee0c58820ef40183f1e363d8).

For future reference, the PR which hopefully fixes this in a future lightning library release: alexbosworth/lightning#214

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