Improve eth1 logging

This commit is contained in:
Paul Hauner
2019-11-26 09:09:26 +11:00
parent 68f0e632f3
commit 81f89c054c
4 changed files with 23 additions and 4 deletions

View File

@@ -54,6 +54,11 @@ impl BlockCache {
self.blocks.is_empty()
}
/// Returns the timestamp of the earliest block in the cache (if any).
pub fn earliest_block_timestamp(&self) -> Option<u64> {
self.blocks.first().map(|block| block.timestamp)
}
/// Returns the highest block number stored.
pub fn highest_block_number(&self) -> Option<u64> {
self.blocks.last().map(|block| block.number)