From 17f15b6daeb6ddf9bb05c302f32cc47beca7eae8 Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Mon, 29 Oct 2018 15:03:23 +0000 Subject: [PATCH] Adapter check compact archive (#1873) * we do want to run compaction for archive nodes (from the adapter) * rustfmt --- servers/src/common/adapters.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/src/common/adapters.rs b/servers/src/common/adapters.rs index 52b79dfb..e7a89dc8 100644 --- a/servers/src/common/adapters.rs +++ b/servers/src/common/adapters.rs @@ -436,7 +436,9 @@ impl NetToChainAdapter { // We cannot process blocks earlier than the horizon so check for this here. { let head = self.chain().head().unwrap(); - let horizon = head.height.saturating_sub(global::cut_through_horizon() as u64); + let horizon = head + .height + .saturating_sub(global::cut_through_horizon() as u64); if b.header.height < horizon { return true; } @@ -515,8 +517,8 @@ impl NetToChainAdapter { } fn check_compact(&self) { - // no compaction during sync or if we're in historical mode - if self.archive_mode || self.sync_state.is_syncing() { + // Skip compaction if we are syncing. + if self.sync_state.is_syncing() { return; }