Repository navigation
feat(wallet): block Core-funded sends until the chain has synced - #843
Merged
Merged
Conversation
Before SyncingActivityMonitor reports .syncDone the persisted UTXO set can be stale (spent inputs, missing recent funds), so a Core-funded spend could be rejected or double-spend a UTXO consumed while offline. - WalletSendService.ensureChainSynced(): boundary guard on prepareStandardSendForConfirmation / send / sendToContact, throwing a localized chainNotSynced error — covers every programmatic path (payment processor, scan-QR, contact payments). CoinJoin sweep stays ungated (recovery to the wallet's own address). - SendViewModel + InternalTransferViewModel observe the monitor (with deinit removal — the observer array holds strongly); Continue is disabled for routes that spend Core UTXOs (coreToCore, coreToShielded, coreToPlatform, incl. the pinned sheet variants). - Shared SyncGateNote banner on both screens says why Continue is off instead of leaving a dead button. Platform- and Shielded-funded routes stay available during sync — their balances come from Platform-side syncs, not the L1 UTXO set. Gating is on SyncingActivityMonitor per the repo guardrail (never raw SPV state). Co-Authored-By: Claude Fable 5 <[email protected]>
|
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.
What
Core-funded sends are now blocked until the L1 chain sync completes. Before
SyncingActivityMonitorreports.syncDone, the persisted UTXO set can be stale — already-spent inputs or missing recent funds — so a built transaction could be rejected or, worse, double-spend a UTXO consumed while the wallet was offline.WalletSendService.ensureChainSynced()):prepareStandardSendForConfirmation,send(...), andsendToContactthrow a localizedchainNotSyncederror while unsynced — covering every programmatic path (payment processor, scan-QR pay flow, DashPay contact payments). CoinJoin sweep is deliberately not gated (recovery to the wallet's own address).SendViewModelandInternalTransferViewModelobserve the monitor; Continue is disabled for any route that spends Core UTXOs —coreToCore,coreToShielded,coreToPlatform, including the balance-row sheets' pinned variants.SyncGateNotebanner on the Send and Internal transfer screens explains why Continue is disabled ("Your wallet is still syncing…") instead of leaving a dead button.Platform- and Shielded-funded routes (platform→platform/core/shielded, shielded→anything) stay available during sync — their balances come from the Platform-side syncs, not the L1 UTXO set.
Per the repo guardrail, gating is on
SyncingActivityMonitor(.syncDone), never raw SPV state (dash-spv's synced steady state iswaitForEvents).Implementation notes
deinit(same pattern asSyncingAlertViewModel).@Publishedstate.Testing
Testnet smoke on QA-iPhone16 / iPhone 16 Pro sims: fresh launch mid-sync shows the banner and a disabled Continue on Send (Core destination) and on Transparent-funded internal transfers, while Shielded→Core stays enabled; once the monitor flips to synced the banner disappears and sends work; scan-QR pay during sync surfaces the localized error instead of building a tx. Unit-test target pre-existing-broken per CLAUDE.md.
🤖 Generated with Claude Code