Skip to content

Commit

Permalink
Use raise_minimum_stake_delegation feature in the stake program impl
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed May 4, 2022
1 parent 874b2eb commit 37a4fe0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions programs/stake/src/stake_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use {
account_utils::StateMut,
clock::{Clock, Epoch},
feature_set::{
stake_allow_zero_undelegated_amount, stake_merge_with_unmatched_credits_observed,
self, stake_allow_zero_undelegated_amount, stake_merge_with_unmatched_credits_observed,
stake_split_uses_rent_sysvar, FeatureSet,
},
instruction::{checked_add, InstructionError},
Expand Down Expand Up @@ -1033,7 +1033,8 @@ fn validate_delegated_amount(
// With the `stake_allow_zero_undelegated_amount` feature, stake accounts
// may be initialized with a lower balance, so check the minimum in this
// function, on delegation.
if feature_set.is_active(&stake_allow_zero_undelegated_amount::id())
if (feature_set.is_active(&stake_allow_zero_undelegated_amount::id())
|| feature_set.is_active(&feature_set::stake_raise_minimum_delegation_to_1_sol::id()))
&& stake_amount < crate::get_minimum_delegation(feature_set)
{
return Err(StakeError::InsufficientStake.into());
Expand Down

0 comments on commit 37a4fe0

Please sign in to comment.