Merge pull request #1362 from ethcore/fix_migration

fixed migration of empty pruning dir
This commit is contained in:
Robert Habermeier 2016-06-21 12:21:31 +02:00 committed by GitHub
commit 06ba7e258e

View File

@ -89,6 +89,7 @@ fn current_version(path: &PathBuf) -> Result<u32, Error> {
/// Writes current database version to the file. /// Writes current database version to the file.
/// Creates a new file if the version file does not exist yet. /// Creates a new file if the version file does not exist yet.
fn update_version(path: &PathBuf) -> Result<(), Error> { fn update_version(path: &PathBuf) -> Result<(), Error> {
try!(fs::create_dir_all(path));
let mut file = try!(File::create(version_file_path(path))); let mut file = try!(File::create(version_file_path(path)));
try!(file.write_all(format!("{}", CURRENT_VERSION).as_bytes())); try!(file.write_all(format!("{}", CURRENT_VERSION).as_bytes()));
Ok(()) Ok(())