Updates the latest canonical block number and evicts any cached entries at or below it (they can no longer be useful).
(&mut self, block_number: BlockNumber)
| 75 | /// Updates the latest canonical block number and evicts any cached entries |
| 76 | /// at or below it (they can no longer be useful). |
| 77 | pub fn update_canonical(&mut self, block_number: BlockNumber) { |
| 78 | self.latest_canonical = Some(block_number); |
| 79 | self.entries.retain(|&bn, _| bn > block_number); |
| 80 | } |
| 81 | |
| 82 | /// Returns the number of distinct block numbers currently cached. |
| 83 | pub fn len(&self) -> usize { |