fix: exclude orphan coop close balances#1043
Open
ovitrif wants to merge 3 commits into
Open
Conversation
6f22641 to
2a140df
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
Scoped the orphan guard’s transfer lookup to Resolved in 76f5132 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1041
Refs #599
Refs #808
This PR fixes the transient Spending balance overstatement after a cooperative channel close by excluding orphaned cooperative-close claimables from the displayed Lightning total.
Description
COOP_CLOSEClaimableAwaitingConfirmationsbalances when the channel no longer exists locally and no active transfer owns that channel.Preview
QA Notes
Manual Tests
masterbaseline → same wallet/app data with an orphan cooperative-close claimable and a new Spending channel → Home: Spending incorrectly includes both the orphan close amount and the new channel amount; recordbefore.mp4.ovi/fix-1041-orphan-coop-closeover the same app data, without uninstalling or clearing storage → Home: Spending shows only the new channel amount, while Savings/on-chain still reflects the closing funds; recordafter.mp4.regression:Active cooperative close transfer → Home balances: transfer-to-savings amount stays hidden from Spending without showing a duplicate in-transfer amount.regression:Active force-close transfer with pending sweep → Home balances: transfer-to-savings progress remains visible until sweep detection settles it.Automated Checks
DeriveBalanceStateUseCaseTest.ktcovers orphanCOOP_CLOSEsubtraction and non-coop-close claimables staying in Lightning.TransferRepoTest.ktcovers not settling transfer-to-savings and cooperative-close transfers when balances are unavailable.just compile,just test,just lint, andgit diff --check;just lintstill reports the existingHwWalletRepoTest.ktLargeClassfinding.