From b98e5e06a6b836dfa3992803e8cdefacee75e1f7 Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Wed, 10 Jun 2020 13:56:33 +0100 Subject: [PATCH] fix race condition (#3344) --- chain/src/pipe.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index 8f6bc3433..f92a8eb86 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -219,14 +219,7 @@ pub fn sync_block_headers( txhashset::header_extending(&mut ctx.header_pmmr, &mut ctx.batch, |ext, batch| { rewind_and_apply_header_fork(&last_header, ext, batch)?; Ok(()) - })?; - - let header_head = ctx.batch.header_head()?; - if has_more_work(last_header, &header_head) { - update_header_head(&Tip::from_header(last_header), &mut ctx.batch)?; - } - - Ok(()) + }) } /// Process a block header. Update the header MMR and corresponding header_head if this header