Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
CLI: Export error message and less verbose peer counter. (#5870)
Browse files Browse the repository at this point in the history
* Removed numbed of active connections from informant

* Print error message when fatdb is required

* Remove peers from UI
  • Loading branch information
arkpar authored Jun 27, 2017
1 parent 5948876 commit 4a7bcfe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/src/views/Application/Status/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Status extends Component {
{ netChain }
</div>
<div className={ styles.peers }>
{ netPeers.active.toFormat() }/{ netPeers.connected.toFormat() }/{ netPeers.max.toFormat() } peers
{ netPeers.connected.toFormat() }/{ netPeers.max.toFormat() } peers
</div>
</div>
</div>
Expand Down
12 changes: 9 additions & 3 deletions parity/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ fn start_client(
fat_db: Switch,
compaction: DatabaseCompactionProfile,
wal: bool,
cache_config: CacheConfig
cache_config: CacheConfig,
require_fat_db: bool,
) -> Result<ClientService, String> {

// load spec file
Expand Down Expand Up @@ -343,6 +344,9 @@ fn start_client(

// check if fatdb is on
let fat_db = fatdb_switch_to_bool(fat_db, &user_defaults, algorithm)?;
if !fat_db && require_fat_db {
return Err("This command requires Parity to be synced with --fat-db on.".to_owned());
}

// prepare client and snapshot paths.
let client_path = db_dirs.client_path(algorithm);
Expand Down Expand Up @@ -395,7 +399,8 @@ fn execute_export(cmd: ExportBlockchain) -> Result<(), String> {
cmd.fat_db,
cmd.compaction,
cmd.wal,
cmd.cache_config
cmd.cache_config,
false,
)?;
let format = cmd.format.unwrap_or_default();

Expand Down Expand Up @@ -435,7 +440,8 @@ fn execute_export_state(cmd: ExportState) -> Result<(), String> {
cmd.fat_db,
cmd.compaction,
cmd.wal,
cmd.cache_config
cmd.cache_config,
true
)?;

let client = service.client();
Expand Down
3 changes: 1 addition & 2 deletions parity/informant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,14 @@ impl Informant {
false => String::new(),
},
match (&sync_status, &network_config) {
(&Some(ref sync_info), &Some(ref net_config)) => format!("{}{}/{}/{} peers",
(&Some(ref sync_info), &Some(ref net_config)) => format!("{}{}/{} peers",
match importing {
true => format!("{} ", paint(Green.bold(), format!("{:>8}", format!("#{}", sync_info.last_imported_block_number.unwrap_or(chain_info.best_block_number))))),
false => match sync_info.last_imported_old_block_number {
Some(number) => format!("{} ", paint(Yellow.bold(), format!("{:>8}", format!("#{}", number)))),
None => String::new(),
}
},
paint(Cyan.bold(), format!("{:2}", sync_info.num_active_peers)),
paint(Cyan.bold(), format!("{:2}", sync_info.num_peers)),
paint(Cyan.bold(), format!("{:2}", sync_info.current_max_peers(net_config.min_peers, net_config.max_peers))),
),
Expand Down

0 comments on commit 4a7bcfe

Please sign in to comment.