fix: return correct file client tip (#1385)

This commit is contained in:
Dan Cline
2023-02-15 18:53:17 -05:00
committed by GitHub
parent 139372fb76
commit 03f74a53be

View File

@@ -112,7 +112,7 @@ impl FileClient {
/// Get the tip hash of the chain.
pub fn tip(&self) -> Option<H256> {
self.headers.get(&(self.headers.len() as u64 - 1)).map(|h| h.hash_slow())
self.headers.get(&(self.headers.len() as u64)).map(|h| h.hash_slow())
}
/// Use the provided bodies as the file client's block body buffer.