Bump snap version and tweak importing detection logic (#6079) (#6081)

* bump last tick just before printing info and restore sync detection

* bump kovan snapshot version

* Fixed sync tests

* Fixed rpc tests
This commit is contained in:
Arkadiy Paronyan
2017-07-18 18:38:07 +02:00
committed by GitHub
parent 7ef4bbd5f7
commit 6f2ec07baa
7 changed files with 18 additions and 17 deletions

View File

@@ -21,9 +21,10 @@ use ethsync::SyncState;
/// Check if client is during major sync or during block import.
pub fn is_major_importing(sync_state: Option<SyncState>, queue_info: BlockQueueInfo) -> bool {
let is_syncing_state = sync_state.map_or(false, |s|
s != SyncState::Idle && s != SyncState::NewBlocks
);
let is_syncing_state = sync_state.map_or(false, |s| match s {
SyncState::Idle | SyncState::NewBlocks | SyncState::WaitingPeers => false,
_ => true,
});
let is_verifying = queue_info.unverified_queue_size + queue_info.verified_queue_size > 3;
is_verifying || is_syncing_state
}