Skip to content

Commit

Permalink
convert to warn as this is possible when there is a slashing event
Browse files Browse the repository at this point in the history
  • Loading branch information
Ank4n committed Nov 3, 2023
1 parent 163b77d commit d30f93a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions substrate/frame/staking/src/pallet/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1903,12 +1903,12 @@ impl<T: Config> Pallet<T> {
})
.collect::<Result<Vec<_>, _>>()?;

// we take total instead of active as the nominator might have requested to unbond
// We take total instead of active as the nominator might have requested to unbond
// some of their stake that is still exposed in the current era.
ensure!(
sum <= Self::ledger(StakingAccount::Stash(nominator.clone()))?.total,
"nominator stake exceeds what is bonded."
);
// This can happen when there is a slash in the current era so we only warn.
if sum <= Self::ledger(Stash(nominator.clone()))?.total {
log!(warn, "nominator stake exceeds what is bonded.");
}

Ok(())
})
Expand Down

0 comments on commit d30f93a

Please sign in to comment.