Skip to content

fix: reconnect custom channel peers after migration#784

Draft
jvsena42 wants to merge 3 commits intomasterfrom
fix/custom-channels-migration
Draft

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

Conversation

@jvsena42
Copy link
Member

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

N/A - no UI changes.

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. One-time execution

  1. After a successful migration peer recovery, restart the app
  2. Verify the peer recovery does not run again (the flag prevents retry)

@jvsena42 jvsena42 self-assigned this Feb 16, 2026
@jvsena42
Copy link
Member Author

Draft for testing

@jvsena42 jvsena42 marked this pull request as draft February 16, 2026 14:35
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