diff --git a/Cargo.lock b/Cargo.lock index 2a54a1a5b..126cb2dd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3319,6 +3319,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" dependencies = [ + "cc", "pkg-config", "vcpkg", ] @@ -9491,6 +9492,7 @@ dependencies = [ "prost", "rand 0.8.5", "ring", + "rusqlite", "rust-embed", "rustls 0.23.36", "sapling-crypto", diff --git a/zingolib/Cargo.toml b/zingolib/Cargo.toml index ad0d4fc47..2d4a82669 100644 --- a/zingolib/Cargo.toml +++ b/zingolib/Cargo.toml @@ -22,6 +22,8 @@ regtest = [ "zingo_common_components/for_test" ] [dependencies] +rusqlite = { version = "0.37.0", features = ["bundled"] } + # Zingo zingo-memo = { workspace = true } zingo-status = { workspace = true } diff --git a/zingolib/src/lightclient/save.rs b/zingolib/src/lightclient/save.rs index 302e3414b..6398860ec 100644 --- a/zingolib/src/lightclient/save.rs +++ b/zingolib/src/lightclient/save.rs @@ -27,9 +27,13 @@ fn write_to_path(wallet_path: &std::path::Path, bytes: &[u8]) -> std::io::Result let file = writer.into_inner().map_err(|e| e.into_error())?; file.sync_all()?; std::fs::rename(&temp_wallet_path, wallet_path)?; - if let Some(parent) = wallet_path.parent() { - let wallet_dir = std::fs::File::open(parent)?; - let _ignore_error = wallet_dir.sync_all(); // NOTE: error is ignored as syncing dirs on windows OS may return an error + // NOTE: in windows no need to sync the folder, only for linux & macOS. + #[cfg(unix)] + { + if let Some(parent) = wallet_path.parent() { + let wallet_dir = std::fs::File::open(parent)?; + let _ignore_error = wallet_dir.sync_all(); + } } Ok(())