mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-16 15:10:20 +00:00
long epochs
This commit is contained in:
@@ -12,7 +12,7 @@ use crate::{
|
||||
},
|
||||
state::{Bus, Config},
|
||||
utils::AccountDeserialize,
|
||||
BUS_COUNT, BUS_EPOCH_REWARDS, MAX_EPOCH_REWARDS, MAX_SUPPLY, MINT_ADDRESS, ONE_MINUTE,
|
||||
BUS_COUNT, BUS_EPOCH_REWARDS, EPOCH_DURATION, MAX_EPOCH_REWARDS, MAX_SUPPLY, MINT_ADDRESS,
|
||||
SMOOTHING_FACTOR, TARGET_EPOCH_REWARDS, TREASURY, TREASURY_BUMP,
|
||||
};
|
||||
|
||||
@@ -79,8 +79,11 @@ pub fn process_reset<'a, 'info>(
|
||||
|
||||
// Validate enough time has passed since last reset
|
||||
let clock = Clock::get().or(Err(ProgramError::InvalidAccountData))?;
|
||||
let threshold = config.last_reset_at.saturating_add(ONE_MINUTE);
|
||||
if clock.unix_timestamp.lt(&threshold) {
|
||||
if config
|
||||
.last_reset_at
|
||||
.saturating_add(EPOCH_DURATION)
|
||||
.gt(&clock.unix_timestamp)
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user