Skip to content
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

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

roeierez
Copy link
Member

No description provided.

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());
Copy link
Collaborator

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:

let working_dir = config.get_wallet_working_dir(fingerprint_hex)?;

Do we need to add it again?

Copy link
Member Author

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.

Copy link
Collaborator

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

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warn!("Update height too old, wipping storage and retrying");
warn!("Update height too old, wiping storage and retrying");

Copy link
Collaborator

@dangeross dangeross left a 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

@roeierez roeierez merged commit 1cbe6d7 into main Nov 14, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants