mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
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:
@@ -70,7 +70,7 @@ use sc_network_common::{
|
||||
NotificationSender as NotificationSenderT, NotificationSenderError,
|
||||
NotificationSenderReady as NotificationSenderReadyT, Signature, SigningError,
|
||||
},
|
||||
sync::{SyncState, SyncStatus},
|
||||
sync::SyncStatus,
|
||||
ExHashT,
|
||||
};
|
||||
use sc_peerset::PeersetHandle;
|
||||
@@ -1997,11 +1997,13 @@ where
|
||||
*this.external_addresses.lock() = external_addresses;
|
||||
}
|
||||
|
||||
let is_major_syncing =
|
||||
match this.network_service.behaviour_mut().user_protocol_mut().sync_state().state {
|
||||
SyncState::Idle => false,
|
||||
SyncState::Downloading => true,
|
||||
};
|
||||
let is_major_syncing = this
|
||||
.network_service
|
||||
.behaviour_mut()
|
||||
.user_protocol_mut()
|
||||
.sync_state()
|
||||
.state
|
||||
.is_major_syncing();
|
||||
|
||||
this.is_major_syncing.store(is_major_syncing, Ordering::Relaxed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user