Repository navigation
Conversation
tankyleo
commented
Dec 4, 2026
Contributor
For wallets using Bitcoin Core, a reorg that removes the birthday checkpoint can leave BDK unable to connect replacement blocks to its saved checkpoints. The wallet then stops tracking the active chain: incoming payments can go undiscovered and balances can remain stale. Restarting reloads the same orphaned checkpoint, leaving the user needing wallet recovery. Using the current tip as the birthday exposes a newly created wallet to this failure after even a one-block reorg, including before its first sync. Avoiding historical scanning should not make ordinary chain reorganizations require user intervention. We budget for reorgs of up to 10 blocks. Accepting up to 10 additional blocks of initial scanning gives the wallet a checkpoint outside that window. This bounded startup cost is preferable to leaving a fresh wallet unable to synchronize until recovered. Co-Authored-By: Codex
Requesting a recent rescan height should not leave a new Bitcoin Core wallet more vulnerable to reorgs than using the default. If its birthday checkpoint is removed, the wallet can stop following the active chain. Restarting reloads the same checkpoint, leaving the user needing wallet recovery. Treat the requested height as history we must include, while retaining at least the same 10-block margin as the default. Scanning a little extra history is preferable to requiring wallet recovery after an ordinary reorg, and earlier requests must never lose any requested history. A fresh wallet therefore needs a known chain tip even when an explicit rescan height is supplied. Co-Authored-By: Codex
|
👋 Thanks for assigning @tnull as a reviewer! |
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.