From a56426e2405c8779ac12ae4e63d8d8e17db3d51a Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Mon, 5 Aug 2024 20:49:03 -0400 Subject: [PATCH] check for default --- programs/steward/src/state/steward_state.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/programs/steward/src/state/steward_state.rs b/programs/steward/src/state/steward_state.rs index b8c392f..62b9e59 100644 --- a/programs/steward/src/state/steward_state.rs +++ b/programs/steward/src/state/steward_state.rs @@ -975,8 +975,11 @@ impl StewardState { stake_deposit_unstake_lamports, total_unstake_lamports, }) => { - self.validator_lamport_balances[index] = self.validator_lamport_balances[index] - .saturating_sub(total_unstake_lamports); + if self.validator_lamport_balances[index] != LAMPORT_BALANCE_DEFAULT { + self.validator_lamport_balances[index] = self.validator_lamport_balances + [index] + .saturating_sub(total_unstake_lamports); + } self.scoring_unstake_total = self .scoring_unstake_total