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

No way to rescan cached filters, without retrieving them again #156

Open
optout21 opened this issue May 14, 2024 · 1 comment
Open

No way to rescan cached filters, without retrieving them again #156

optout21 opened this issue May 14, 2024 · 1 comment

Comments

@optout21
Copy link

Preamble: It's possible that there is a way just I could not find it, or there is some fundamental reason why this is not possible.

I could not use nakamoto in a way, that when blocks and filters are already downloaded and cached, it re-verifies the filters, without downloading them again.

Use cases:

  • Restart client after some time, and reevaluate/reload loaded client (rescan for transactions)
  • Having a client with cached data, load and scan another wallet, without re-downloading all the filters.

I observed the following phases, when starting the client:

  • loading: blocks (and filters?) are read from disk
  • filter retrieval is initiated, from the beginning or the provided hint block height, even if they were previously downloaded
  • filters are checked.

Re-downloading the filters can takes some time (10-20 minutes).

In the code, I found these relevant parts:

  • client Handle rescan() (handle.rs)
  • Filter Manager rescan() (cbfmgs.rs), calls into
  • Filter Manager get_cfilters() (cbfmgs.rs).

I suggest to expose the functionality of re-scanning cached filters.

Any comments appreciated.

@blakebyrnes
Copy link

blakebyrnes commented May 15, 2024

@optout21 Did you see this happening over the wire? Perusing the code for something else, the logic in cbfmgr.rs#get_cfilters calls rescan.rs#requests which seems to intend to skip anything in cache.

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

No branches or pull requests

2 participants