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
[feat] Allow rescan on pruned nodes #3518
Comments
Hi, This looks like a very useful enhancement for pruned blockchains. I've analysed the requirements for a bit and, as a test, added preliminary test feature to force re-scan for pruned blockchain and make On line 37
|
Hi, I did some more work on this issue and came up with draft solution. For basic functionality, as per requirement to work with optional height, rescanning worked for pruned node, with simple error-checking. I tested on 2.2GB pruned node:
Is this something that makes sense and can be submitted as a PR? Thanks. Of course, disable this condition and error message:
|
Interesting approach! What happens if the ancestor is not accessible? For example, if you keep the last 1000 blocks and you try to rescan from a block older than is on disk? I had trouble implementing this myself, which is why I ask and why I haven't submitted my own PR. |
If I understood the problem correctly, in this case we get an error: I think that due to the nature of pruned blockchain it won't be possible to access wallet transactions older than those stored in blocks available on disk (due to them being pruned) and so the When I ran rescan with my implementation (on a blockchain that I am also synchronizing because I fell behind on that):
|
Hi, May I propose a minor variant on my earlier approach? Rather than having user specify height from which to begin wallet rescan, if user doesn't provide Here are the changes I am proposing: In
I ran modified code with the following command-line arguments and got the following printout:
Note: here, I have not fully synchronized pruned blockchain which I had to restore from backup. Thanks. |
Currently,
rescan
fails on pruned nodes with an error. It should be possible to rescan a pruned node if an optional height is provided and that height is within the blocks contained within the pruned node.The text was updated successfully, but these errors were encountered: