diff --git a/pallets/collator-selection/src/lib.rs b/pallets/collator-selection/src/lib.rs index 79f17bbc11..3b8671cbf1 100644 --- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -572,10 +572,11 @@ pub mod pallet { let (locked_until, _) = NonCandidates::::get(&who); if T::ValidatorSet::session_index() > locked_until { // bond is already unlocked - continue; + >::remove(who); + } else { + // slash un-bonding candidate + Self::slash_non_candidate(&who); } - // slash un-bonding candidate - Self::slash_non_candidate(&who); } } ( diff --git a/pallets/collator-selection/src/tests.rs b/pallets/collator-selection/src/tests.rs index 17299bf425..037883fa1f 100644 --- a/pallets/collator-selection/src/tests.rs +++ b/pallets/collator-selection/src/tests.rs @@ -565,7 +565,7 @@ fn should_not_slash_unbonding_candidates() { initialize_to_block(20); assert_eq!(SessionChangeBlock::get(), 20); - assert_eq!(LastAuthoredBlock::::get(3), 10); + assert!(!LastAuthoredBlock::::contains_key(3)); assert_eq!(LastAuthoredBlock::::get(4), 20); assert_eq!(NonCandidates::::get(3), (1, 10));