From 7371beb26c910344e6342b550ef793f2a8f7a254 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Thu, 17 Mar 2016 15:09:08 +0100 Subject: [PATCH] get rid of the function --- sync/src/chain.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 501964251..8bb0c7c80 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -625,13 +625,6 @@ impl ChainSync { self.state = SyncState::Waiting; } - fn can_sync(&self) -> bool { - match self.state { - SyncState::Idle | SyncState::NotSynced => true, - _ => false - } - } - /// Find something to do for a peer. Called for a new peer or when a peer is done with it's task. fn sync_peer(&mut self, io: &mut SyncIo, peer_id: PeerId, force: bool) { let (peer_latest, peer_difficulty) = { @@ -651,7 +644,7 @@ impl ChainSync { if force || peer_difficulty > syncing_difficulty { // start sync self.syncing_difficulty = peer_difficulty; - if self.can_sync() { + if self.state == SyncState::Idle || self.state == SyncState::NotSynced { self.state = SyncState::Blocks; } trace!(target: "sync", "Starting sync with better chain");