From 99ae734638ccd0fc1c272c72973f7d98817d0855 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 24 May 2019 13:56:46 +1000 Subject: [PATCH] Add saturating sub to slash_validator --- eth2/state_processing/src/common/slash_validator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth2/state_processing/src/common/slash_validator.rs b/eth2/state_processing/src/common/slash_validator.rs index 3fce3756e..2a2db1a77 100644 --- a/eth2/state_processing/src/common/slash_validator.rs +++ b/eth2/state_processing/src/common/slash_validator.rs @@ -37,7 +37,7 @@ pub fn slash_validator( 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);