keep nominations after getting kicked with zero slash (#4681)

* keep nominations after getting kicked with zero slash

* rename next_key to maybe_next_key

Co-Authored-By: Gavin Wood <gavin@parity.io>

Co-authored-by: Gavin Wood <github@gavwood.com>
This commit is contained in:
Robert Habermeier
2020-01-20 15:58:39 +01:00
committed by GitHub
parent 4e0ac574e2
commit 3ae5e1640b
4 changed files with 169 additions and 13 deletions
+2 -2
View File
@@ -1482,11 +1482,11 @@ impl<T: Trait> Module<T> {
let Nominations { submitted_in, mut targets, suppressed: _ } = nominations;
// Filter out nomination targets which were nominated before the most recent
// slashing span.
// non-zero slash.
targets.retain(|stash| {
<Self as Store>::SlashingSpans::get(&stash).map_or(
true,
|spans| submitted_in >= spans.last_start(),
|spans| submitted_in >= spans.last_nonzero_slash(),
)
});