From fd8c03679af95f87e21c48b1ec798d359f237dba Mon Sep 17 00:00:00 2001 From: Antioch Peverell <apeverell@protonmail.com> Date: Sat, 29 Sep 2018 08:47:50 +0100 Subject: [PATCH] use sync_head consistently in sync_block_headers (#1604) * use sync_head consistently in sync_block_headers * rustfmt --- chain/src/pipe.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index a68920ff8..e0263b540 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -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(