aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/db.rs b/src/db.rs
index 85d43a0..98aa984 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -27,7 +27,7 @@ pub struct Db {
27} 27}
28 28
29impl Db { 29impl Db {
30 pub fn new() -> Self { 30 pub fn new(config: Config) -> Self {
31 fs::create_dir_all("blocks").unwrap(); 31 fs::create_dir_all("blocks").unwrap();
32 fs::create_dir_all("users").unwrap(); 32 fs::create_dir_all("users").unwrap();
33 let mut db = Db::default(); 33 let mut db = Db::default();
@@ -46,14 +46,7 @@ impl Db {
46 blockchain: Arc::new(RwLock::new(Block::default())), 46 blockchain: Arc::new(RwLock::new(Block::default())),
47 pending_transactions: Arc::new(RwLock::new(HashMap::new())), 47 pending_transactions: Arc::new(RwLock::new(HashMap::new())),
48 users: Arc::new(RwLock::new(users)), 48 users: Arc::new(RwLock::new(users)),
49 config: Config { 49 config,
50 block_transaction_count: 4,
51 register_bonus: 100,
52 block_reward: 4,
53 tx_upper_limit: 4,
54 tx_lower_limit: 1,
55 tx_traffic_reward: 1,
56 },
57 preapproved_users, 50 preapproved_users,
58 } 51 }
59 } 52 }