Skip to content

Commit

Permalink
Add seperate default DB path for light client (openethereum#8927)
Browse files Browse the repository at this point in the history
  • Loading branch information
mttmartin committed Jul 11, 2018
1 parent da5de4a commit b6b8f69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,12 @@ impl Configuration {
let data_path = replace_home("", &base_path);
let is_using_base_path = self.args.arg_base_path.is_some();
// If base_path is set and db_path is not we default to base path subdir instead of LOCAL.
let base_db_path = if is_using_base_path && self.args.arg_db_path.is_none() {
let base_db_path = if is_using_base_path && self.args.arg_db_path.is_none() && self.args.flag_light {
"$BASE/chains_light"
} else if is_using_base_path && self.args.arg_db_path.is_none() {
"$BASE/chains"
} else if self.args.flag_light {
self.args.arg_db_path.as_ref().map_or(dir::CHAINS_PATH_LIGHT, |s| &s)
} else {
self.args.arg_db_path.as_ref().map_or(dir::CHAINS_PATH, |s| &s)
};
Expand Down
8 changes: 6 additions & 2 deletions util/dir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ use platform::*;

pub use dirs::home_dir;

/// Platform-specific chains path - Windows only
/// Platform-specific chains path for standard client - Windows only
#[cfg(target_os = "windows")] pub const CHAINS_PATH: &str = "$LOCAL/chains";
/// Platform-specific chains path
/// Platform-specific chains path for light client - Windows only
#[cfg(target_os = "windows")] pub const CHAINS_PATH_LIGHT: &str = "$LOCAL/chains_light";
/// Platform-specific chains path for standard client
#[cfg(not(target_os = "windows"))] pub const CHAINS_PATH: &str = "$BASE/chains";
/// Platform-specific chains path for light client
#[cfg(not(target_os = "windows"))] pub const CHAINS_PATH_LIGHT: &str = "$BASE/chains_light";

/// Platform-specific cache path - Windows only
#[cfg(target_os = "windows")] pub const CACHE_PATH: &str = "$LOCAL/cache";
Expand Down

0 comments on commit b6b8f69

Please sign in to comment.