examples/lockup: Disallow vesting accounts with invalid periods
This commit is contained in:
parent
f0297012c6
commit
a078b683b8
|
@ -78,6 +78,9 @@ pub mod lockup {
|
|||
if end_ts <= ctx.accounts.clock.unix_timestamp {
|
||||
return Err(ErrorCode::InvalidTimestamp.into());
|
||||
}
|
||||
if period_count > (end_ts - ctx.accounts.clock.unix_timestamp) as u64 {
|
||||
return Err(ErrorCode::InvalidPeriod.into());
|
||||
}
|
||||
if period_count == 0 {
|
||||
return Err(ErrorCode::InvalidPeriod.into());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue