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:
Antioch Peverell
2019-07-26 08:36:24 +01:00
committed by GitHub
parent 45cf1d96df
commit 515fa54614
11 changed files with 390 additions and 706 deletions
+1 -7
View File
@@ -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,
}
}