Skip to content

Commit

Permalink
NDRS-895: update to match old block structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser999 committed Feb 18, 2021
1 parent 8e2221a commit f5b1b6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions node/src/components/consensus/era_supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,14 +654,18 @@ where
.and_then(|switch_id| switch_blocks.get(&switch_id));

let newly_slashed = maybe_switch_block
.and_then(|bhdr| bhdr.era_end())
.and_then(|bhdr| bhdr.era_report())
.map(|era_end| era_end.equivocators.clone())
.unwrap_or_default();

let slashed = self
.era_supervisor
.iter_past_other(era_id, self.era_supervisor.bonded_eras)
.filter_map(|old_id| switch_blocks.get(&old_id).and_then(|bhdr| bhdr.era_end()))
.filter_map(|old_id| {
switch_blocks
.get(&old_id)
.and_then(|bhdr| bhdr.era_report())
})
.flat_map(|era_end| era_end.equivocators.clone())
.collect();

Expand Down

0 comments on commit f5b1b6f

Please sign in to comment.