Skip to content

Fix balance candidate selection during pending splices#865

Open
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:balance-candidate-index
Open

Fix balance candidate selection during pending splices#865
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:balance-candidate-index

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

Mirror LDK's sentinel logic for confirmed_balance_candidate_index in ClaimableOnChannelClose: when the index is 0 (no specific alternative funding confirmed), use the last balance candidate (most current splice/RBF attempt) instead of the first. This aligns with LDK's claimable_amount_satoshis() behavior and fixes a mismatch where total_lightning_balance_sats could differ from the sum of individual LightningBalance amounts during pending splices.

AI tools were used in preparing this commit.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 2, 2026

🎉 This PR is now ready for review!
Please choose at least one reviewer by assigning them on the right bar.
If no reviewers are assigned within 10 minutes, I'll automatically assign one.
Once the first reviewer has submitted a review, a second will be assigned if required.

Mirror LDK's sentinel logic for confirmed_balance_candidate_index in
ClaimableOnChannelClose: when the index is 0 (no specific alternative
funding confirmed), use the last balance candidate (most current
splice/RBF attempt) instead of the first. This aligns with LDK's
claimable_amount_satoshis() behavior and fixes a mismatch where
total_lightning_balance_sats could differ from the sum of individual
LightningBalance amounts during pending splices.

AI tools were used in preparing this commit.
@joostjager joostjager force-pushed the balance-candidate-index branch from 01dfa3a to 2549a4d Compare April 2, 2026 11:31
@joostjager joostjager requested a review from tnull April 2, 2026 12:43
@joostjager joostjager marked this pull request as ready for review April 2, 2026 12:43
@joostjager joostjager self-assigned this Apr 2, 2026
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.

2 participants