diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index d399b1cf1..90ec8693f 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -127,6 +127,7 @@ impl Client { } } +/// Get the path for the databases given the root path and information on the databases. pub fn get_db_path(path: &Path, pruning: journaldb::Algorithm, genesis_hash: H256) -> PathBuf { let mut dir = path.to_path_buf(); dir.push(H64::from(genesis_hash).hex()); @@ -136,6 +137,7 @@ pub fn get_db_path(path: &Path, pruning: journaldb::Algorithm, genesis_hash: H25 dir } +/// Append a path element to the given path and return the string. pub fn append_path(path: &Path, item: &str) -> String { let mut p = path.to_path_buf(); p.push(item); diff --git a/parity/main.rs b/parity/main.rs index c2673cc8a..8c4a9ddf0 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -550,6 +550,7 @@ impl Configuration { let jdb_types = [journaldb::Algorithm::Archive, journaldb::Algorithm::EarlyMerge, journaldb::Algorithm::OverlayRecent, journaldb::Algorithm::RefCounted]; for i in jdb_types.into_iter() { let db = journaldb::new(&append_path(&get_db_path(&Path::new(&self.path()), *i, spec.genesis_header().hash()), "state"), *i); + trace!(target: "parity", "Looking for best DB: {} at {:?}", i, db.latest_era()); match (latest_era, db.latest_era()) { (Some(best), Some(this)) if best >= this => {} (_, None) => {} @@ -582,7 +583,7 @@ impl Configuration { "auto" => self.find_best_db(spec).unwrap_or(journaldb::Algorithm::OverlayRecent), _ => { die!("Invalid pruning method given."); } }; - info!("Using state DB of {}", client_config.pruning); + trace!(target: "parity", "Using pruning strategy of {}", client_config.pruning); client_config.name = self.args.flag_identity.clone(); client_config.queue.max_mem_use = self.args.flag_queue_max_size; client_config