diff --git a/programs/voter-stake-registry/src/instructions/extend_stake.rs b/programs/voter-stake-registry/src/instructions/extend_stake.rs index e726f8d8..86758c8e 100644 --- a/programs/voter-stake-registry/src/instructions/extend_stake.rs +++ b/programs/voter-stake-registry/src/instructions/extend_stake.rs @@ -41,13 +41,12 @@ pub fn extend_stake( additional_amount, VsrError::InsufficientUnlockedTokens ); - require!( target.lockup.period != LockupPeriod::None && target.lockup.kind != LockupKind::None, VsrError::ExtendDepositIsNotAllowed ); + let start_ts = target.lockup.start_ts; - let curr_ts = clock_unix_timestamp(); let target_basic_amount = target.amount_deposited_native; let current_lockup_period = if target.lockup.expired(curr_ts) { LockupPeriod::Flex @@ -57,12 +56,10 @@ pub fn extend_stake( // different type of deposit is only allowed if // the current deposit has expired - if current_lockup_period != LockupPeriod::Flex { - require!( - new_lockup_period >= current_lockup_period, - VsrError::ExtendDepositIsNotAllowed - ); - } + require!( + new_lockup_period >= current_lockup_period, + VsrError::ExtendDepositIsNotAllowed + ); // Check target compatibility require_eq!(