Remove unnecessary height check in sync. (think it was only there for tests)

This commit is contained in:
Ignotus Peverell 2018-03-22 19:26:29 +00:00
parent 9beb66a75e
commit ee678b28d0
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211
2 changed files with 2 additions and 3 deletions

View file

@ -427,8 +427,7 @@ impl NetToChainAdapter {
// We are out of consensus at this point and want to track the problem // We are out of consensus at this point and want to track the problem
// down as soon as possible. // down as soon as possible.
// Skip this if we are currently syncing (too slow). // Skip this if we are currently syncing (too slow).
if chain.head().unwrap().height > 0 if chain.head().unwrap().height > 0 && !self.currently_syncing.load(Ordering::Relaxed)
&& !self.currently_syncing.load(Ordering::Relaxed)
&& self.config.chain_validation_mode == ChainValidationMode::EveryBlock && self.config.chain_validation_mode == ChainValidationMode::EveryBlock
{ {
let now = Instant::now(); let now = Instant::now();

View file

@ -67,7 +67,7 @@ pub fn run_sync(
// in archival nodes (no fast sync) we just consider we have the whole // in archival nodes (no fast sync) we just consider we have the whole
// state already // state already
let have_txhashset = !fast_sync 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( let mut syncing = needs_syncing(
currently_syncing.as_ref(), currently_syncing.as_ref(),