-
Notifications
You must be signed in to change notification settings - Fork 7
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
Wipe storage cache in case of data corrupted issue #566
Conversation
Err(lwk_wollet::Error::UpdateHeightTooOld { .. }) => { | ||
warn!("Update height too old, wipping storage and retrying"); | ||
let mut path = working_dir.as_ref().to_path_buf(); | ||
path.push(elements_network.as_str()); |
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 think the passed working_dir is already formatted with the network/fingerprint here:
breez-sdk-liquid/lib/core/src/sdk.rs
Line 156 in 8f3c303
let working_dir = config.get_wallet_working_dir(fingerprint_hex)?; |
Do we need to add it again?
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.
Yes but the lwk wallet dir is a nested directory under that directory.
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.
Ah right, it's the ElementsNetwork, sorry
lib/core/src/wallet.rs
Outdated
let mut path = working_dir.as_ref().to_path_buf(); | ||
path.push(elements_network.as_str()); | ||
fs::remove_dir_all(&path)?; | ||
warn!("Wippping wallet in path: {:?}", path); |
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.
warn!("Wippping wallet in path: {:?}", path); | |
warn!("Wiping wallet in path: {:?}", path); |
match Wollet::new(elements_network, lwk_persister, descriptor.clone()) { | ||
Ok(wollet) => Ok(wollet), | ||
Err(lwk_wollet::Error::UpdateHeightTooOld { .. }) => { | ||
warn!("Update height too old, wipping storage and retrying"); |
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.
warn!("Update height too old, wipping storage and retrying"); | |
warn!("Update height too old, wiping storage and retrying"); |
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.
LGTM, just the 2 log typos
No description provided.