Skip to content

Commit

Permalink
Add comment for clear_unconfirmed_slot() in blockstore.rs (solana-lab…
Browse files Browse the repository at this point in the history
  • Loading branch information
yhchiang-sol authored Dec 15, 2021
1 parent e476e17 commit 71b12b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,13 @@ impl Blockstore {
Ok((newly_completed_data_sets, inserted_indices))
}

/// Range-delete all entries which prefix matches the specified `slot` and
/// clear all the related `SlotMeta` except its next_slots.
///
/// This function currently requires `insert_shreds_lock`, as both
/// `clear_unconfirmed_slot()` and `insert_shreds_handle_duplicate()`
/// try to perform read-modify-write operation on [`cf::SlotMeta`] column
/// family.
pub fn clear_unconfirmed_slot(&self, slot: Slot) {
let _lock = self.insert_shreds_lock.lock().unwrap();
if let Some(mut slot_meta) = self
Expand Down

0 comments on commit 71b12b1

Please sign in to comment.