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

The root cause was that after wallet restoration, LDK couldn't find a confirmed channel's funding transaction on Electrum, because it is a zero-conf channel restored before the transaction is confirmed, causing an infinite retry loop until timeout.
Also the retry flow was setting the node state as initialLifecycleState on repository, even it being running on service

Preview

master-with-crash.webm
fixed.webm

QA Notes

1. Verify sync error handling

  1. Receive 10K sats on CJIT
  2. Reset and restored the wallet before the channel is confirmed
  3. Verify the app remains responsive and doesn't crash
  4. Perform LN transactions

@jvsena42 jvsena42 changed the title fix: sync exception not caught causing app crash fix: sync exception caught causing app crash Jan 19, 2026
@jvsena42 jvsena42 marked this pull request as ready for review January 19, 2026 16:53
@jvsena42 jvsena42 requested a review from Copilot January 19, 2026 16:55
connectToTrustedPeers().onFailure {
Logger.error("Failed to connect to trusted peers", it, context = TAG)
}
sync().getOrThrow().also {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because of this, the repository was setting the node state as initialLifecycleState on repository, even it being running on service

This comment was marked as outdated.

@claude

This comment has been minimized.

@jvsena42 jvsena42 marked this pull request as draft January 19, 2026 17:25
@jvsena42

This comment was marked as resolved.

@jvsena42 jvsena42 marked this pull request as ready for review January 19, 2026 17:32
@claude
Copy link

claude bot commented Jan 19, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jvsena42
Copy link
Member Author

@piotr-iohk the test is breaking because of the quick pay sheet
https://github.com/synonymdev/bitkit-android/actions/runs/21151606591/job/60831722037?pr=657

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