Skip to content

rebalance: handle channels without short_channel_id#888

Merged
daywalker90 merged 1 commit into
lightningd:masterfrom
bittylicious:fix-rebalance-missing-short-channel-id
Jun 29, 2026
Merged

rebalance: handle channels without short_channel_id#888
daywalker90 merged 1 commit into
lightningd:masterfrom
bittylicious:fix-rebalance-missing-short-channel-id

Conversation

@bittylicious

@bittylicious bittylicious commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

The rebalance plugin can crash in peer_from_scid when listpeerchannels returns entries without a short_channel_id, such as channels that are not yet announced/locked in.

This changes the lookup to use ch.get("short_channel_id") before comparing, matching the defensive pattern already used elsewhere in the plugin.

Observed against Core Lightning v26.06 while running an explicit rebalance; the RPC failed with KeyError: 'short_channel_id'.

Validation:\n- python3 -m py_compile rebalance/rebalance.py rebalance/test_rebalance.py

  • Applied equivalent one-line fix on a running node and confirmed explicit rebalance commands complete successfully.

@daywalker90

Copy link
Copy Markdown
Collaborator

Good catch , thank you @bittylicious !

@daywalker90 daywalker90 merged commit 0027610 into lightningd:master Jun 29, 2026
7 checks passed
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.

2 participants