use crate::mempool::MempoolAnchorId;
use crate::types::ShardDescriptionShort;
pub fn detect_top_processed_to_anchor<I>(
mc_top_shards: I,
mc_processed_to_anchor_id: MempoolAnchorId,
) -> MempoolAnchorId
where
I: Iterator<Item = ShardDescriptionShort>,
{
let mut min_top = mc_processed_to_anchor_id;
for ShardDescriptionShort {
top_sc_block_updated,
ext_processed_to_anchor_id,
..
} in mc_top_shards
{
if top_sc_block_updated {
min_top = min_top.min(ext_processed_to_anchor_id);
}
}
min_top
}