mirror of
https://github.com/mimblewimble/grin.git
synced 2025-04-20 01:11:14 +03:00
use sync_head consistently in sync_block_headers (#1604)
* use sync_head consistently in sync_block_headers * rustfmt
This commit is contained in:
parent
9e6ef6f237
commit
fd8c03679a
1 changed files with 4 additions and 3 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue