cloudhead / cloudhead/nakamoto

No way to rescan cached filters, without retrieving them again

Open
#156 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
391
Forks
64
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.