Adapter check compact archive (#1873)
* we do want to run compaction for archive nodes (from the adapter) * rustfmt
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user