mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-01 21:14:43 -05:00
Deterministic peer id from seed for alice
This includes the introduction of the --data-dir parameter instead of the --database. Both the seed file and the database are stored in the data-dir, the database in sub-folder `database`.
This commit is contained in:
parent
64ba8d6a87
commit
0a21040e08
18 changed files with 377 additions and 35 deletions
14
swap/src/fs.rs
Normal file
14
swap/src/fs.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use std::path::Path;
|
||||
|
||||
pub fn ensure_directory_exists(file: &Path) -> Result<(), std::io::Error> {
|
||||
if let Some(path) = file.parent() {
|
||||
if !path.exists() {
|
||||
tracing::info!(
|
||||
"Parent directory does not exist, creating recursively: {}",
|
||||
file.display()
|
||||
);
|
||||
return std::fs::create_dir_all(path);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue