Get PathBuf even if /zebrad-cache exists for create_cached_database_height()

This commit is contained in:
Deirdre Connolly 2020-12-30 20:16:44 -05:00 committed by Deirdre Connolly
parent f2a21ac67c
commit f5b3412a50
1 changed files with 3 additions and 1 deletions

View File

@ -672,7 +672,9 @@ fn create_cached_database_height(network: Network, height: Height) -> Result<()>
// TODO: add convenience methods?
config.network.network = network;
config.state.debug_stop_at_height = Some(height.0);
let dir = PathBuf::from("/zebrad-cache").with_config(config)?;
let dir = PathBuf::from("/zebrad-cache");
fs::File::create(dir.join("zebrad.toml"))?.write_all(toml::to_string(&config)?.as_bytes())?;
let mut child = dir
.spawn_child(&["start"])?