Skip to content

fix: reconnect custom channel peers after migration#784

Open
jvsena42 wants to merge 4 commits intomasterfrom
fix/custom-channels-migration
Open

fix: reconnect custom channel peers after migration#784
jvsena42 wants to merge 4 commits intomasterfrom
fix/custom-channels-migration

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Feb 16, 2026

Fixes #772

This PR reconnects custom channel peers after migrating from the React Native app by fetching the peers list from the RN remote backup on first node start.

Description

After migrating from RN Bitkit, custom Lightning channels (opened manually or via LNURL with non-LSP nodes) are restored from backup but the app doesn't reconnect to those channel counterparties. Without the peer connection, those channels are unusable.

The fix adds a one-time peer recovery step that runs after the node starts and trusted peers connect:

  1. Fetches peers.json from the RN remote backup server
  2. Filters out trusted/LSP peers (already handled)
  3. Connects to the remaining custom peers with persist: true so ldk-node remembers them for future starts

This is a port of the iOS fix in synonymdev/bitkit-ios#436.

Preview

backyard-compatibility.mp4
migrate-directly.webm

QA Notes

1. Migration with custom channels

  1. Have a wallet on RN Bitkit with at least one custom channel (non-LSP peer)
  2. Migrate to the native Android app
  3. After migration completes and the node starts, check logs for: Migration peer recovery: fetched N peer(s) from remote backup
  4. Verify the custom channel becomes usable without manual reconnection

2. No migration - no side effects

  1. Use a wallet that was created natively (no RN migration)
  2. Start the app normally
  3. Verify no errors in logs related to peer recovery
  4. Verify the method returns early without making any backup requests

3. Backyard compatibility

  1. Have a wallet on RN Bitkit with at least one custom channel (non-LSP peer)
  2. Migrate to master branch
  3. The channels will migrate but the beer will not connect
  4. Checkout to this branch
  5. Peers should connect successfully

@jvsena42 jvsena42 self-assigned this Feb 16, 2026
@jvsena42

This comment was marked as outdated.

@jvsena42 jvsena42 marked this pull request as draft February 16, 2026 14:35
@jvsena42 jvsena42 marked this pull request as ready for review February 17, 2026 10:20
@jvsena42
Copy link
Member Author

@jvsena42 jvsena42 requested a review from ovitrif February 17, 2026 10:37
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.

[Bug]: Custom channel peers not reconnected after migration

1 participant