Rewind head and header_head consistently. (#2918)
* maintain header_head as distinctly separate from head * cleanup corrupted storage log msg * simplify process_header and check_header_known * remember to commit the batch when successfully processing a header... * rework sync_block_headers for consistency with process_block_header * cleanup unrelated code * fix pool tests * cleanup chain tests * cleanup chain tests (reuse helpers more) * cleanup - head not header on an extension shortcircuit "rewind and apply fork" for headers if next header
This commit is contained in:
+1
-7
@@ -109,13 +109,7 @@ where
|
||||
pub fn read(&self, position: u64) -> Option<T> {
|
||||
match self.file.read_as_elmt(position - 1) {
|
||||
Ok(x) => Some(x),
|
||||
Err(e) => {
|
||||
error!(
|
||||
"Corrupted storage, could not read an entry from data file: {:?}",
|
||||
e
|
||||
);
|
||||
None
|
||||
}
|
||||
Err(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user