Skip to content

peersync: Keep connected peers in listpeers#431

Draft
YusukeShimizu wants to merge 1 commit into
ElementsProject:masterfrom
YusukeShimizu:fix/peersync-connected-peer-cleanup
Draft

peersync: Keep connected peers in listpeers#431
YusukeShimizu wants to merge 1 commit into
ElementsProject:masterfrom
YusukeShimizu:fix/peersync-connected-peer-cleanup

Conversation

@YusukeShimizu

@YusukeShimizu YusukeShimizu commented May 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #425.

pscli listpeers is backed by peersync state, not only by LND's active peer/channel state. A peer could therefore be removed from the peersync store by stale cleanup when its last peersync observation aged out, even if the lightning backend still reported the peer as connected.

This matches the issue timing: peerswapd started around 05:48, and the peer disappeared around 08:49. With the previous cleanup cadence, a peer observed shortly after startup could be dropped later by peersync cleanup despite still being active in LND.

@YusukeShimizu YusukeShimizu force-pushed the fix/peersync-connected-peer-cleanup branch from 05edebb to 0953094 Compare May 14, 2026 03:29
Keep peers that are still connected according to the lightning
backend out of stale peersync cleanup. Request a fresh poll from
connected peers that are missing from the store, and persist peer
capability data from REQUEST_POLL messages so the store refreshes on
both halves of the peersync handshake.

Add regression coverage for connected-but-expired peers, rediscovery of
connected peers missing from the store, and REQUEST_POLL persistence.
@YusukeShimizu YusukeShimizu force-pushed the fix/peersync-connected-peer-cleanup branch from 0953094 to 4c738bf Compare May 19, 2026 11:29
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.

Peerswap drops peer while LND channel still active

1 participant