Remove NetworkService::config() (#8653)

This commit is contained in:
Pierre Krieger
2018-06-01 09:49:46 +02:00
committed by Marek Kotewicz
parent 485d4aa8f3
commit dab967ace8
6 changed files with 62 additions and 32 deletions

View File

@@ -145,7 +145,8 @@ impl InformantData for FullNodeInformantData {
let (importing, sync_info) = match (self.sync.as_ref(), self.net.as_ref()) {
(Some(sync), Some(net)) => {
let status = sync.status();
let net_config = net.network_config();
let num_peers_range = net.num_peers_range();
debug_assert!(num_peers_range.end > num_peers_range.start);
cache_sizes.insert("sync", status.mem_used);
@@ -154,7 +155,7 @@ impl InformantData for FullNodeInformantData {
last_imported_block_number: status.last_imported_block_number.unwrap_or(chain_info.best_block_number),
last_imported_old_block_number: status.last_imported_old_block_number,
num_peers: status.num_peers,
max_peers: status.current_max_peers(net_config.min_peers, net_config.max_peers),
max_peers: status.current_max_peers(num_peers_range.start, num_peers_range.end - 1),
snapshot_sync: status.is_snapshot_syncing(),
}))
}