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
+2 -1
View File
@@ -58,7 +58,8 @@ impl ChainAdapter {
let batch = s.batch().unwrap();
batch.save_block_header(header).unwrap();
batch.save_head(&tip).unwrap();
batch.save_body_head(&tip).unwrap();
batch.save_header_head(&tip).unwrap();
// Retrieve previous block_sums from the db.
let prev_sums = if let Ok(prev_sums) = batch.get_block_sums(&tip.prev_block_h) {