Peers RPC + UI displaying active/connected/max peers (#1915)

* Peers API

* Bumping Parity-UI

* Fixing tests
This commit is contained in:
Tomasz Drwięga
2016-08-11 17:19:20 +02:00
committed by Arkadiy Paronyan
parent 07844d611e
commit f114a933a3
13 changed files with 167 additions and 82 deletions

View File

@@ -187,6 +187,15 @@ impl SyncStatus {
pub fn is_major_syncing(&self) -> bool {
self.state != SyncState::Idle && self.state != SyncState::NewBlocks
}
/// Returns max no of peers to display in informants
pub fn current_max_peers(&self, min_peers: u32, max_peers: u32) -> u32 {
if self.num_peers as u32 > min_peers {
max_peers
} else {
min_peers
}
}
}
#[derive(PartialEq, Eq, Debug, Clone)]