use sync_head consistently in sync_block_headers ()

* use sync_head consistently in sync_block_headers

* rustfmt
This commit is contained in:
Antioch Peverell 2018-09-29 08:47:50 +01:00 committed by GitHub
parent 9e6ef6f237
commit fd8c03679a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,7 +217,7 @@ pub fn sync_block_headers(
);
}
let mut tip = batch.get_header_head()?;
let mut sync_tip = batch.get_sync_head()?;
for header in headers {
handle_block_header(header, ctx, batch)?;
@ -227,9 +227,10 @@ pub fn sync_block_headers(
// and become the "most work" chain.
// header_head and sync_head will diverge in this situation until we switch to
// a single "most work" chain.
tip = update_sync_head(header, ctx, batch)?;
sync_tip = update_sync_head(header, ctx, batch)?;
}
Ok(tip)
Ok(sync_tip)
}
fn handle_block_header(