Skip to content

Commit febcce1

Browse files
committed
Revert "Update the best block when best proposal header is updated"
This reverts commit e6c6f95.
1 parent e6c6f95 commit febcce1

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

core/src/client/importer.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ impl Importer {
318318
_importer_lock: &MutexGuard<()>,
319319
) -> usize {
320320
let prev_best_proposal_header_hash = client.block_chain().best_proposal_header().hash();
321-
let prev_best_block_hash = client.block_chain().best_block_hash();
322321

323322
let mut bad = HashSet::new();
324323
let mut imported = Vec::new();
@@ -351,8 +350,7 @@ impl Importer {
351350
self.header_queue.mark_as_bad(&bad.drain().collect::<Vec<_>>());
352351
let (enacted, retracted) = self.calculate_enacted_retracted(&routes);
353352

354-
let new_best_proposal_header = client.block_chain().best_proposal_header();
355-
let new_best_proposal_header_hash = new_best_proposal_header.hash();
353+
let new_best_proposal_header_hash = client.block_chain().best_proposal_header().hash();
356354
let best_proposal_header_changed = if prev_best_proposal_header_hash != new_best_proposal_header_hash {
357355
Some(new_best_proposal_header_hash)
358356
} else {
@@ -369,14 +367,6 @@ impl Importer {
369367
best_proposal_header_changed,
370368
);
371369

372-
let maybe_new_best_block_hash = new_best_proposal_header.parent_hash();
373-
if best_proposal_header_changed.is_some()
374-
&& prev_best_block_hash != maybe_new_best_block_hash
375-
&& client.block(&BlockId::Hash(maybe_new_best_block_hash)).is_some()
376-
{
377-
client.update_best_as_committed(maybe_new_best_block_hash);
378-
}
379-
380370
client.db().flush().expect("DB flush failed.");
381371

382372
imported.len()

0 commit comments

Comments
 (0)