Skip to content

Commit

Permalink
Add code comment for get_slot_meta_entry 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 5fb7da1 commit e374fb1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3268,6 +3268,24 @@ fn get_index_meta_entry<'a>(
res
}

/// Obtain the SlotMeta from the in-memory slot_meta_working_set or load
/// it from the database if it does not exist in slot_meta_working_set.
///
/// In case none of the above has the specified SlotMeta, a new one will
/// be created.
///
/// Note that this function will also update the parent slot of the specified
/// slot.
///
/// Arguments:
/// - `db`: the database
/// - `slot_meta_working_set`: a in-memory structure for storing the cached
/// SlotMeta.
/// - `slot`: the slot for loading its meta.
/// - `parent_slot`: the parent slot to be assigned to the specified slot meta
///
/// This function returns the matched `SlotMetaWorkingSetEntry`. If such entry
/// does not exist in the database, a new entry will be created.
fn get_slot_meta_entry<'a>(
db: &Database,
slot_meta_working_set: &'a mut HashMap<u64, SlotMetaWorkingSetEntry>,
Expand Down

0 comments on commit e374fb1

Please sign in to comment.