Skip to content

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Jan 16, 2026

Fixes #652

This PR fixes the "Bitkit keeps stopping" crash that occurs after wallet restoration when LDK's transaction sync encounters an unconfirmed channel funding transaction on Electrum.

Description

  1. Adds proper error handling in LightningRepo.sync() using runCatching to catch and propagate sync failures
  2. Shows a user-friendly toast notification in WalletViewModel when sync timeout occurs instead of silently ignoring it
  3. Adds localized string resources for the error message

The root cause was that after wallet restoration, LDK couldn't find a channel's funding transaction on Electrum, causing an infinite retry loop until timeout. The exception was not properly handled, leaving the app appearing frozen and eventually triggering a crash.

Preview

QA Notes

1. Verify sync error handling

  1. Get a CJIT channel
  2. Reset and restored the wallet before the channel is confirmed
  3. Sync or restore may fail due to the unconfirmed channel
  4. Verify the app remains responsive and doesn't crash

3. Regression tests

  • Send a Lightning payment
  • Receive a Lightning payment
  • Open Lightning Connections screen

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] Bitkit keeps stopping Error

2 participants