Skip to content

Commit

Permalink
impl
Browse files Browse the repository at this point in the history
  • Loading branch information
pugachAG committed Apr 17, 2024
1 parent 6d17fa9 commit f9174c1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl OrphanStateWitnessPool {
pub fn remove_witnesses_below_final_height(&mut self, final_height: BlockHeight) {
let mut to_remove: Vec<(ShardId, BlockHeight)> = Vec::new();
for ((witness_shard, witness_height), cache_entry) in self.witness_cache.iter() {
if *witness_height < final_height {
if *witness_height <= final_height {
to_remove.push((*witness_shard, *witness_height));
let header = &cache_entry.witness.chunk_header;
tracing::debug!(
Expand Down Expand Up @@ -358,7 +358,7 @@ mod tests {
let waiting_for_100 = pool.take_state_witnesses_waiting_for_block(&block(100));
assert_contents(waiting_for_100, vec![witness2]);

pool.remove_witnesses_below_final_height(103);
pool.remove_witnesses_below_final_height(102);

let waiting_for_99 = pool.take_state_witnesses_waiting_for_block(&block(99));
assert_contents(waiting_for_99, vec![]);
Expand Down

0 comments on commit f9174c1

Please sign in to comment.