Skip to content

Commit

Permalink
Skip operator in do_slash_operators if it is not found
Browse files Browse the repository at this point in the history
Signed-off-by: linning <linningde25@gmail.com>
  • Loading branch information
NingLin-P committed Dec 8, 2023
1 parent ed93719 commit e9a58b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/pallet-domains/src/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,13 @@ where
{
for (operator_id, reason) in operator_ids {
Operators::<T>::try_mutate(operator_id, |maybe_operator| {
let operator = maybe_operator.as_mut().ok_or(Error::UnknownOperator)?;
let operator = match maybe_operator.as_mut() {
// If the operator is already slashed and removed due to fraud proof, when the operator
// is slash again due to invalid bundle, which happen after the ER is confirmed, we can
// not find the operator here thus just return.
None => return Ok(()),
Some(operator) => operator,
};
let mut pending_slashes =
PendingSlashes::<T>::get(operator.current_domain_id).unwrap_or_default();

Expand Down

0 comments on commit e9a58b5

Please sign in to comment.