diff options
author | necrashter | 2022-04-23 15:37:37 +0300 |
---|---|---|
committer | Yigit Sever | 2022-04-23 18:10:12 +0300 |
commit | 85dc0418b8b3b7e6d10a4ae85878a921b67c9baf (patch) | |
tree | 7d61cea14546b91fcb857bed7a2292bcbcff5d86 /src/handlers.rs | |
parent | 2541f5f849e25d7a5483c5715ef2e84945016637 (diff) | |
download | gradecoin-85dc0418b8b3b7e6d10a4ae85878a921b67c9baf.tar.gz gradecoin-85dc0418b8b3b7e6d10a4ae85878a921b67c9baf.tar.bz2 gradecoin-85dc0418b8b3b7e6d10a4ae85878a921b67c9baf.zip |
Save different networks to different folders
Diffstat (limited to 'src/handlers.rs')
-rw-r--r-- | src/handlers.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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( | |||
333 | }) | 333 | }) |
334 | .unwrap(); | 334 | .unwrap(); |
335 | 335 | ||
336 | fs::write(format!("users/{}.guy", new_user.user_id), user_at_rest_json).unwrap(); | 336 | fs::write( |
337 | format!("users/{}/{}.guy", db.config.name, new_user.user_id), | ||
338 | user_at_rest_json | ||
339 | ).unwrap(); | ||
337 | 340 | ||
338 | let mut userlist = db.users.write(); | 341 | let mut userlist = db.users.write(); |
339 | userlist.insert(fingerprint.clone(), new_user); | 342 | userlist.insert(fingerprint.clone(), new_user); |
@@ -601,7 +604,7 @@ pub async fn propose_block( | |||
601 | let block_json = serde_json::to_string(&new_block).unwrap(); | 604 | let block_json = serde_json::to_string(&new_block).unwrap(); |
602 | 605 | ||
603 | fs::write( | 606 | fs::write( |
604 | format!("blocks/{}.block", new_block.timestamp.timestamp()), | 607 | format!("blocks/{}/{}.block", db.config.name, new_block.timestamp.timestamp()), |
605 | block_json, | 608 | block_json, |
606 | ) | 609 | ) |
607 | .unwrap(); | 610 | .unwrap(); |