Adapter check compact archive (#1873)

* we do want to run compaction for archive nodes (from the adapter)

* rustfmt
This commit is contained in:
Antioch Peverell
2018-10-29 15:03:23 +00:00
committed by GitHub
parent 46051ee174
commit 17f15b6dae
+5 -3
View File
@@ -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;
}