Skip to content

Commit

Permalink
Actually cleanup old blocks if archive_mode=false (#1814)
Browse files Browse the repository at this point in the history
* actually cleanup old blocks if not in archive mode

* rustfmt
  • Loading branch information
antiochp authored Oct 23, 2018
1 parent 38cbd6e commit a433725
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit a433725

Please sign in to comment.