Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
babe: reorder checks in check_and_report_equivocation
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilva committed Jul 3, 2020
1 parent 4b1b2ce commit dbc9ee2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,12 @@ where
author: &AuthorityId,
origin: &BlockOrigin,
) -> Result<(), Error<Block>> {
// don't report any equivocations during initial sync
// as they are most likely stale.
if *origin == BlockOrigin::NetworkInitialSync {
return Ok(());
}

// check if authorship of this header is an equivocation and return a proof if so.
let equivocation_proof =
match check_equivocation(&*self.client, slot_now, slot, header, author)
Expand All @@ -777,12 +783,6 @@ where
None => return Ok(()),
};

// don't report any equivocations during initial sync
// as they are most likely stale.
if *origin == BlockOrigin::NetworkInitialSync {
return Ok(());
}

info!(
"Slot author {:?} is equivocating at slot {} with headers {:?} and {:?}",
author,
Expand Down

0 comments on commit dbc9ee2

Please sign in to comment.