From 85dc0418b8b3b7e6d10a4ae85878a921b67c9baf Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 15:37:37 +0300 Subject: Save different networks to different folders --- src/handlers.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/handlers.rs') diff --git a/src/handlers.rs b/src/handlers.rs index f80aa60..d2a834f 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -333,7 +333,10 @@ pub async fn authenticate_user( }) .unwrap(); - fs::write(format!("users/{}.guy", new_user.user_id), user_at_rest_json).unwrap(); + fs::write( + format!("users/{}/{}.guy", db.config.name, new_user.user_id), + user_at_rest_json + ).unwrap(); let mut userlist = db.users.write(); userlist.insert(fingerprint.clone(), new_user); @@ -601,7 +604,7 @@ pub async fn propose_block( let block_json = serde_json::to_string(&new_block).unwrap(); fs::write( - format!("blocks/{}.block", new_block.timestamp.timestamp()), + format!("blocks/{}/{}.block", db.config.name, new_block.timestamp.timestamp()), block_json, ) .unwrap(); -- cgit v1.2.3-70-g09d2