Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make scanning requirements explicit #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rustaceanrob
Copy link
Collaborator

@rustaceanrob rustaceanrob commented Jan 25, 2025

There is a bit of guess-work going on when the user provides a wallet birthday. If the local chain tip is at height 0, then it is assumed that the user is trying to either 1. recover from the provided birthday 2. sync the chain from the latest checkpoint because its a new wallet. This is a little dangerous because a poor implementation may not configure the birthday, and would miss the old transactions. Also the code is convoluted and hard to reason about. To get around both of these, a ScanType is introduced to force the developer to specify what it is they are doing. If the implementation neglects this type and a user is trying to recover a wallet, the scan will start from height 0. To explicitly ignore old block headers and start a new wallet, one would pass ScanType::New

edit: I preserved the scan_after method on the builder, so this can technically be released as a patch release to the best of my semver knowledge

@rustaceanrob rustaceanrob force-pushed the recovery-1-25 branch 2 times, most recently from 1ccc474 to 68106ef Compare January 25, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant