Function update_index_by_hash

Source
fn update_index_by_hash<H: Eq + Hash, P: Ord>(
    index: &mut HashMap<H, P>,
    hash: H,
    pos: P,
)
Expand description

Update an index mapping hashes of objects to their positions in the ledger.

This function will insert the mapping from hash to pos into index, unless there is already an entry for hash at an earlier position in the ledger.