Skip to content

Commit

Permalink
Merge pull request #2304 from subspace/fix-slash-operator
Browse files Browse the repository at this point in the history
Skip operator in do_slash_operators if it is not found
  • Loading branch information
NingLin-P authored Dec 11, 2023
2 parents b58a025 + e9a58b5 commit d521915
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 d521915

Please sign in to comment.