Repository navigation
feat(ui): show Locked on immature coinbase reward rows - #854
Merged
romchornyi merged 1 commit intoJul 22, 2026
Merged
Conversation
Transaction._state only ever returned .processing or .ok, so the .locked case (rendered as the "Locked" trailing label on coinbase reward rows) was never produced — the label regressed to always-absent. Carry the mined blockHeight into SDKSnapshot and, for a confirmed coinbase transaction, return .locked while fewer than COINBASE_MATURITY (100) blocks sit on top of it (mirrors the legacy DSTransaction.getBlocksToMaturity rule), comparing against SwiftDashSDKSPVCoordinator.tipHeight. Falls back to .ok when height/tip are unknown so the label never sticks, and clears once the reward matures (the home feed rebuilds its Transaction wrappers).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Issue being fixed or feature implemented
The "Locked" status label on coinbase reward transaction rows (shown while the reward is still maturing, < 100 confirmations) never appears. Balance/max were unaffected — only the per-row label regressed.
Root cause:
Transaction._stateonly ever returned.processing(mempool) or.ok, so the.lockedenum case — rendered as the "Locked" trailing label inHomeView— was never produced. The case existed but was dead.This is app/SwiftDashSDK-side. The merged app reads state from the SDK-backed
Transaction, notDSAccount, so the equivalent DashSynclockedBalancefix has no effect here.What was done?
blockHeightintoSDKSnapshot(fromPersistentTransaction.blockHeight;0for synthetic rows)._statenow returns.lockedfor a confirmed coinbase transaction while fewer thanCOINBASE_MATURITY(100) blocks sit on top of the minting block — mirroring the legacyDSTransaction.getBlocksToMaturityrule — comparingsnapshot.blockHeightagainstSwiftDashSDKSPVCoordinator.shared.tipHeight..okwhen height or tip are unknown (height > 0,tip >= height) so the label never sticks, and it clears once the reward matures since the home feed rebuilds itsTransactionwrappers on each reload.How Has This Been Tested?
Not yet run through a device build (Xcode was open; CLI build skipped to avoid a build.db collision). Recommended testnet smoke: with a coinbase/mining reward younger than 100 confirmations in history, the row should show "Locked"; once it passes 100 confirmations the label should clear. Please also confirm on real data that
PersistentTransaction.blockHeightis populated for coinbase rows — if the SDK leaves it 0, the maturity gate won't engage and the source field needs revisiting.Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only