From ee678b28d0ff03c19678981564d054479cd5ed8f Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Thu, 22 Mar 2018 19:26:29 +0000 Subject: [PATCH] Remove unnecessary height check in sync. (think it was only there for tests) --- grin/src/adapters.rs | 3 +-- grin/src/sync.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/grin/src/adapters.rs b/grin/src/adapters.rs index c717c233c..36def8601 100644 --- a/grin/src/adapters.rs +++ b/grin/src/adapters.rs @@ -427,8 +427,7 @@ impl NetToChainAdapter { // We are out of consensus at this point and want to track the problem // down as soon as possible. // Skip this if we are currently syncing (too slow). - if chain.head().unwrap().height > 0 - && !self.currently_syncing.load(Ordering::Relaxed) + if chain.head().unwrap().height > 0 && !self.currently_syncing.load(Ordering::Relaxed) && self.config.chain_validation_mode == ChainValidationMode::EveryBlock { let now = Instant::now(); diff --git a/grin/src/sync.rs b/grin/src/sync.rs index 1bd3d13f9..5b40d1e18 100644 --- a/grin/src/sync.rs +++ b/grin/src/sync.rs @@ -67,7 +67,7 @@ pub fn run_sync( // in archival nodes (no fast sync) we just consider we have the whole // state already let have_txhashset = !fast_sync - || head.height > 0 && header_head.height.saturating_sub(head.height) <= horizon; + || header_head.height.saturating_sub(head.height) <= horizon; let mut syncing = needs_syncing( currently_syncing.as_ref(),