fix(cmd): get tip block (#7591)

This commit is contained in:
Emilia Hane
2024-04-12 15:34:42 +02:00
committed by GitHub
parent 9b5fc9fd8d
commit dd28a4ca73

View File

@@ -116,7 +116,7 @@ impl FileClient {
/// Get the tip hash of the chain.
pub fn tip(&self) -> Option<B256> {
self.headers.get(&(self.headers.len() as u64)).map(|h| h.hash_slow())
self.headers.get(&((self.headers.len() - 1) as u64)).map(|h| h.hash_slow())
}
/// Returns the highest block number of this client has or `None` if empty