-
Notifications
You must be signed in to change notification settings - Fork 29
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
Move chainstate storage init inside constructor #1118
Conversation
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.
Nice, definitely an improvement. Some suggestions below:
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.
This looks fine. Though just a question out of carefulness: I remember we deleting only the database directory. Please confirm that's the case, and that we're not deleting the whole data directory. This is because a user setting a wrong data directory could cause a disaster if a wildcard is used.
yes we are removing only that. So in case chainstate is configured with LMDB |
0e67fa8
to
552e5da
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.
Looks good to me
use serialization::{Decode, Encode}; | ||
|
||
#[derive(Debug, Encode, Decode, Clone, Copy, Eq, PartialEq)] | ||
pub struct ChainstateStorageVersion(u32); |
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.
I've seen many discussions here about what to do about this... and I just want to point out that if we want to make it perfect, we can put all the information (version, magic bytes and net type) in one struct. But I don't really care that much. I'm OK with the way things are now as long as it doesn't lead to a crash and the worst thing that can happen is a wipe and resync.
This is a fix for previous review #1098: