Actually fix major sync detection (#12114)

* Actually fix major sync detection

* Introduce `SyncState::Importing` state

* Add target to SyncState enum variants and add `is_major_syncing` method on it

* Remove unnecessary duplicated `best_seen_block` from `SyncState` struct

* Revert "Remove unnecessary duplicated `best_seen_block` from `SyncState` struct"

This reverts commit bb8abd458c939881c049f69d59f3acba47c97c5c.

* Add missing `websocket` feature to `libp2p`

Co-authored-by: parity-processbot <>
This commit is contained in:
Nazar Mokrynskyi
2022-10-21 16:38:53 +03:00
committed by GitHub
parent 7f8aab84b1
commit bf57a2e92d
6 changed files with 71 additions and 62 deletions
@@ -98,7 +98,7 @@ where
#[derive(Clone)]
pub struct NetworkStatus<B: BlockT> {
/// Current global sync state.
pub sync_state: SyncState,
pub sync_state: SyncState<NumberFor<B>>,
/// Target sync block number.
pub best_seen_block: Option<NumberFor<B>>,
/// Number of peers participating in syncing.