Move the network status reporting to the service (#2916)

* Move the network status reporting to the service

* Fix tests

* Fix build
This commit is contained in:
Pierre Krieger authored and Gavin Wood committed 2019-06-21 17:13:11 -04:00
1 parent 01fcdc2b1a
commit 437a6bc6b1
10 files changed
+167 -112

No files matched your search

@@ -194,22 +194,6 @@ pub struct Status<B: BlockT> {
pub num_peers: u32,
}
impl<B: BlockT> Status<B> {
/// Whether the synchronization status is doing major downloading work or
/// is near the head of the chain.
pub fn is_major_syncing(&self) -> bool {
match self.state {
SyncState::Idle => false,
SyncState::Downloading => true,
}
}
/// Are we all alone?
pub fn is_offline(&self) -> bool {
self.num_peers == 0
}
}
impl<B: BlockT> ChainSync<B> {
/// Create a new instance. Pass the initial known state of the chain.
pub(crate) fn new(role: Roles, info: &ClientInfo<B>) -> Self {