fn discard_stxos<D: Digest>(
    db: &mut RwLockWriteGuard<InnerDatabase<D>>,
    leaf_indices: Vec<u32>,
) -> Result<usize, ChainStorageError>
{
    let mut num_removed = 0;
    for leaf_index in leaf_indices {
        if let (Some(hash), _) = db.utxo_mmr.fetch_mmr_node(leaf_index)? {
            if db.stxos.remove(&hash).is_some() {
                num_removed += 1;
            }
        }
    }
    Ok(num_removed)
}
// Discard the STXOs of the checkpoints that have been merged into the horizon state and return the number of removed
// STXOs.
Discard the STXOs of the checkpoints that have been merged into the horizon state and return the number of removed
STXOs.
Discard the STXOs of the checkpoints that have been merged into the horizon state and return the number of removed STXOs .
fn discard_stxos<D: Digest>(
    db: &mut RwLockWriteGuard<InnerDatabase<D>>,
    leaf_indices: Vec<u32>,
) -> Result<usize, ChainStorageError>
{
    let mut num_removed = 0;
    for leaf_index in leaf_indices {
        if let (Some(hash), _) = db.utxo_mmr.fetch_mmr_node(leaf_index)? {
            if db.stxos.remove(&hash).is_some() {
                num_removed += 1;
            }
        }
    }
    Ok(num_removed)
}
fn discard_stxos < D : Digest > ( db : & mut RwLockWriteGuard < InnerDatabase < D > > , leaf_indices : Vec < u32 > , ) -> Result < usize , ChainStorageError > { let mut num_removed = 0 ; for leaf_index in leaf_indices { if let ( Some ( hash ) , _ ) = db . utxo_mmr . fetch_mmr_node ( leaf_index ) ? { if db . stxos . remove ( & hash ) . is_some ( ) { num_removed += 1 ; } } } Ok ( num_removed ) }
Discard the STXOs of the checkpoints that have been merged into the horizon state and return the number of removed
STXOs.
Discard the STXOs of the checkpoints that have been merged into the horizon state and return the number of removed STXOs .
db
&mut RwLockWriteGuard<InnerDatabase<D>>
leaf_indices
Vec<u32>
db
&mut RwLockWriteGuard<InnerDatabase<D>>
leaf_indices
Vec<u32>