Remove unnecessary height check in sync. (think it was only there for tests)
This commit is contained in:
@@ -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();
|
||||
|
||||
+1
-1
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user