Refactor Sync status updates into a stream of updates (#1858)

* refactor sync provider

* relative use of interval

* typo

* set propagate timeout to 2500ms

* address comments

* fix instant calc

* update intervals
This commit is contained in:
Gregory Terzian
2019-03-02 21:35:16 +08:00
committed by Gav Wood
parent 828cd9580a
commit a81f7f48a0
9 changed files with 90 additions and 54 deletions
+2 -3
View File
@@ -109,10 +109,9 @@ impl<B: traits::Block> SystemApi<B::Hash, <B::Header as HeaderT>::Number> for Sy
}
fn system_health(&self) -> Result<Health> {
let status = self.sync.status();
Ok(Health {
peers: status.num_peers,
is_syncing: status.sync.is_major_syncing(),
peers: self.sync.peers().len(),
is_syncing: self.sync.is_major_syncing(),
should_have_peers: self.should_have_peers,
})
}