Skip to content

Commit

Permalink
allow chain compaction during sync
Browse files Browse the repository at this point in the history
  • Loading branch information
antiochp committed Mar 7, 2021
1 parent 63f36ab commit 667624c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ impl Chain {
// Make sure our output_pos index is consistent with the UTXO set.
txhashset.init_output_pos_index(&header_pmmr, &batch)?;

// TODO - Why is this part of chain compaction?
// Rebuild our NRD kernel_pos index based on recent kernel history.
txhashset.init_recent_kernel_pos_index(&header_pmmr, &batch)?;

Expand Down
5 changes: 0 additions & 5 deletions servers/src/common/adapters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,11 +704,6 @@ where
}

fn check_compact(&self) {
// Skip compaction if we are syncing.
if self.sync_state.is_syncing() {
return;
}

// Roll the dice to trigger compaction at 1/COMPACTION_CHECK chance per block,
// uses a different thread to avoid blocking the caller thread (likely a peer)
let mut rng = thread_rng();
Expand Down
2 changes: 0 additions & 2 deletions servers/src/grin/sync/body_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ impl BodySync {
peers = peers_iter().inbound().into_iter().collect();
}

debug!("*** body_sync: peers: {}", peers.len());

// If we have no peers (outbound or inbound) then we are done for now.
if peers.is_empty() {
debug!("no peers (inbound or outbound) with more work");
Expand Down

0 comments on commit 667624c

Please sign in to comment.