]> git.bitcoin.ninja Git - rust-lightning/commitdiff
sync_all final file
authorValentine Wallace <vwallace@protonmail.com>
Wed, 17 Feb 2021 20:12:18 +0000 (15:12 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 17 Feb 2021 20:16:35 +0000 (15:16 -0500)
lightning-persister/src/util.rs

index d568af561ddb481749838a0485fbf9b7c475f21b..132c20687c386dcac7169a92deb087e5f41a24ba 100644 (file)
@@ -112,6 +112,8 @@ pub(crate) fn write_to_file<D: DiskWriteable>(path: String, filename: String, da
                                winapi::um::winbase::MOVEFILE_WRITE_THROUGH | winapi::um::winbase::MOVEFILE_REPLACE_EXISTING
                        )});
                }
+               let mut final_file = fs::File::open(filename_with_path.clone())?;
+               final_file.sync_all()?;
                println!("VMW: renamed");
        }
        Ok(())