Struct grin_store::leaf_set::LeafSet
source · pub struct LeafSet { /* private fields */ }
Expand description
Compact (roaring) bitmap representing the set of positions of leaves that are currently unpruned in the MMR.
Implementations§
source§impl LeafSet
impl LeafSet
sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<LeafSet>
pub fn open<P: AsRef<Path>>(path: P) -> Result<LeafSet>
Open the remove log file. The content of the file will be read in memory for fast checking.
sourcepub fn copy_snapshot<P: AsRef<Path>>(path: P, cp_path: P) -> Result<()>
pub fn copy_snapshot<P: AsRef<Path>>(path: P, cp_path: P) -> Result<()>
Copies a snapshot of the utxo file into the primary utxo file.
sourcepub fn removed_pre_cutoff(
&self,
cutoff_pos: u64,
rewind_rm_pos: &Bitmap,
prune_list: &PruneList
) -> Bitmap
pub fn removed_pre_cutoff( &self, cutoff_pos: u64, rewind_rm_pos: &Bitmap, prune_list: &PruneList ) -> Bitmap
Calculate the set of pruned positions up to and including the cutoff_pos. Uses both the leaf_set and the prune_list to determine prunedness.
sourcepub fn rewind(&mut self, cutoff_pos: u64, rewind_rm_pos: &Bitmap)
pub fn rewind(&mut self, cutoff_pos: u64, rewind_rm_pos: &Bitmap)
Rewinds the leaf_set back to a previous state. Removes all pos after the cutoff. Adds back all pos in rewind_rm_pos.
sourcepub fn snapshot(&self, header: &BlockHeader) -> Result<()>
pub fn snapshot(&self, header: &BlockHeader) -> Result<()>
Saves the utxo file tagged with block hash as filename suffix. Needed during fast-sync as the receiving node cannot rewind after receiving the txhashset zip file.
sourcepub fn n_unpruned_leaves_to_index(&self, to_index: u64) -> u64
pub fn n_unpruned_leaves_to_index(&self, to_index: u64) -> u64
Number of positions up to index n in the leaf set
Auto Trait Implementations§
impl Freeze for LeafSet
impl RefUnwindSafe for LeafSet
impl Send for LeafSet
impl Sync for LeafSet
impl Unpin for LeafSet
impl UnwindSafe for LeafSet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more