mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-22 11:39:26 +00:00
This commit is contained in:
parent
e3a2877882
commit
864380b15c
1 changed files with 8 additions and 3 deletions
|
@ -39,10 +39,15 @@ pub(crate) fn save_peers_to_disk<Z: BorshNetworkZone>(
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let file = cfg
|
let dir = cfg
|
||||||
.peer_store_directory
|
.peer_store_directory.clone();
|
||||||
|
let file = dir
|
||||||
.join(format!("{}_p2p_state", Z::NAME));
|
.join(format!("{}_p2p_state", Z::NAME));
|
||||||
spawn_blocking(move || fs::write(&file, &data))
|
|
||||||
|
spawn_blocking(move || {
|
||||||
|
fs::create_dir_all(dir)?;
|
||||||
|
fs::write(&file, &data) }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn read_peers_from_disk<Z: BorshNetworkZone>(
|
pub(crate) async fn read_peers_from_disk<Z: BorshNetworkZone>(
|
||||||
|
|
Loading…
Reference in a new issue