From a433725b5dcab6565e5ebcfa1f3937e3b17a9eb6 Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Tue, 23 Oct 2018 13:59:43 +0100 Subject: [PATCH] Actually cleanup old blocks if archive_mode=false (#1814) * actually cleanup old blocks if not in archive mode * rustfmt --- chain/src/chain.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chain/src/chain.rs b/chain/src/chain.rs index f8dc395f..9bc893e5 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -751,8 +751,8 @@ impl Chain { /// Determine the cutoff height from the horizon and the current block height. /// *Only* runs if we are not in archive mode. fn compact_blocks_db(&self) -> Result<(), Error> { - if !self.archive_mode { - return Ok(()) + if self.archive_mode { + return Ok(()); } let horizon = global::cut_through_horizon() as u64; @@ -762,9 +762,7 @@ impl Chain { debug!( "chain: compact_blocks_db: head height: {}, horizon: {}, cutoff: {}", - head.height, - horizon, - cutoff, + head.height, horizon, cutoff, ); if cutoff == 0 {