-
Notifications
You must be signed in to change notification settings - Fork 179
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
Allow cache purging at wallet initialization #1616
Conversation
I will comment that I spent quite a lot of time figuring out a model for this that didn't have side effects. You can't just naively delete the cache at the moment when you start So after a few ideas, I settled on putting it into a config var, with a warning that you generally DO NOT want to use it. That way the change in loading from storage ( The test case is very simple but was enough to show these issues, so it kind of already did its job ... |
Shouldn't |
So to expand on what I said above, I came to the conclusion that probably not. (I know, this is what we both agreed earlier). First, Additionally, this is a pretty special situation - if the cache got screwed up, it would almost certainly have to be a bug in the code, and a really bad one at that. Hence I feel like, if a person found that something was horribly wrong with their wallet syncing process, and they didn't want to start from pure zero (let's say, from seed, |
cr utACK, code seems correct. But see type hint nit comments above. |
Fixes #1614. Prior to this commit, if data in the persisted cache in the wallet file were wrong (should be a very extraordinary case), then the joinmarket code would have to crash with a cache invalid warning. After this commit, in such an extraordinary case, the option exists to invalidate or remove the cache on startup, so that it can be rebuilt from scratch. This is done with a config var wallet_caching_disabled in the POLICY section.
4f61e63
to
ef1d76e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK ef1d76e
Fixes #1614.
Prior to this commit, if data in the persisted cache in the wallet file were wrong (should be a very extraordinary case), then the joinmarket code would have to crash with a cache invalid warning. After this commit, in such an extraordinary case, the option exists to invalidate or remove the cache on startup, so that it can be rebuilt from scratch. This is done with a config var wallet_caching_disabled in the POLICY section.