Просмотр исходного кода

remove wallet and database paths from cashierd config file

ghassmo 4 лет назад
Родитель
Сommit
34171d0369
2 измененных файлов с 10 добавлено и 9 удалено
  1. 10 3
      src/bin/cashierd.rs
  2. 0 6
      src/cli/cli_config.rs

+ 10 - 3
src/bin/cashierd.rs

@@ -62,16 +62,23 @@ impl Cashierd {
 
         let config: CashierdConfig = Config::<CashierdConfig>::load(config_path)?;
 
+        let cashier_wallet_path = join_config_path(&PathBuf::from("cashier_wallet.db"))?;
+
+        let client_wallet_path = join_config_path(&PathBuf::from("cashier_client_wallet.db"))?;
+
         let cashier_wallet = CashierDb::new(
-            &PathBuf::from(config.cashierdb_path.clone()),
+            &cashier_wallet_path,
             config.password.clone(),
         )?;
         let client_wallet = WalletDb::new(
-            &PathBuf::from(config.cashierdb_path.clone()),
+            &client_wallet_path.clone(),
             config.password.clone(),
         )?;
 
-        let rocks = Rocks::new(&PathBuf::from(&config.cashierdb_path))?;
+
+        let database_path = join_config_path(&PathBuf::from("cashier_database.db"))?;
+
+        let rocks = Rocks::new(&database_path)?;
 
         let client = Client::new(
             rocks,

+ 0 - 6
src/cli/cli_config.rs

@@ -90,12 +90,6 @@ pub struct CashierdConfig {
     #[serde(rename = "log_path")]
     pub log_path: String,
 
-    #[serde(rename = "database_path")]
-    pub database_path: String,
-
-    #[serde(rename = "cashierdb_path")]
-    pub cashierdb_path: String,
-
     #[serde(rename = "password")]
     pub password: String,