Add saturating sub to slash_validator

This commit is contained in:
Paul Hauner 2019-05-24 13:56:46 +10:00
parent e43d27f3e4
commit 99ae734638
No known key found for this signature in database
GPG Key ID: 5E2CFF9B75FA63DF

View File

@ -37,7 +37,7 @@ pub fn slash_validator<T: EthSpec>(
safe_add_assign!(state.balances[proposer_index], proposer_reward);
safe_add_assign!(
state.balances[whistleblower_index],
whistleblowing_reward - proposer_reward
whistleblowing_reward.saturating_sub(proposer_reward)
);
safe_sub_assign!(state.balances[slashed_index], whistleblowing_reward);