Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
antiochp committed Feb 14, 2020
1 parent 9c29f4a commit ecd7175
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chain/src/txhashset/txhashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ impl TxHashSet {
Ok(())
}

/// Initialize the kernel_pos index.
/// Find the block header at the kernel index horizon (14 days of history).
/// Then iterate over all kernels since then and add to the index.
pub fn init_kernel_pos_index(
&self,
header_pmmr: &PMMRHandle<BlockHeader>,
Expand Down Expand Up @@ -528,6 +531,8 @@ impl TxHashSet {
Ok(())
}

/// Compact the kernel_pos index by removing any entries older than the kernel index horizon.
/// This will ensure we always have 14 days of kernel history in the index.
fn compact_kernel_pos_index(&self, batch: &Batch<'_>) -> Result<(), Error> {
let now = Instant::now();
let head_header = batch.head_header()?;
Expand Down

0 comments on commit ecd7175

Please sign in to comment.