Repository navigation
Conversation
…over `WALLET_NEEDS_RESCAN` was cleared as soon as `rescanblockchain` was accepted. The node keeps the rescan in memory only, so one lost to an app restart, or one that gave up, left `rescan_in_progress` false just like a finished one and the UI jumped to "fully synced" with the wallet half scanned (#164). The service now follows the rescan it triggered: the flag is cleared when the node stops reporting it without a `rescan_error`; a failure counts against the gate's retry budget and a lost rescan is triggered again once the chain is back at the tip. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Part of #164 — the "filters at 51%, then 100% synced in basically no time" report.
Root cause
The service cleared
WALLET_NEEDS_RESCANas soon as therescanblockchainRPC was accepted. The node keeps its rescan state in memory only (jvsena42/Floresta-mandacaru#45 makes it survive a sleep, but not a process restart), so a rescan lost to an app restart — or one that failed — leftgetblockchaininfo.rescan_in_progressfalse exactly like a finished one, and the sync phase became SYNCED with the wallet half scanned. Reproduced on the emulator: the host suspended mid-rescan, the node's rescan died, the app showed "synced" (the failure is only inrescan_error, which the app did not read).Changes
RescanCompletionTrackerfollows the rescan this process triggered until the node stops reporting it;WALLET_NEEDS_RESCANis cleared only then and only without arescan_error.WalletRescanGatebudget (backoff, give up after 10), one lost to a restart is simply triggered again once the chain is back at the tip and filters are complete.GetBlockchainInfoResponsegainsrescan_error.Tests
RescanCompletionTrackerTest;./gradlew :app:testDebugUnitTest detekt lintDebugpass.Independent of #165.
🤖 Generated with Claude Code