mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-06 07:36:48 +00:00
expiry
This commit is contained in:
@@ -29,6 +29,9 @@ pub const ONE_MINUTE_SLOTS: u64 = 150;
|
|||||||
/// The number of slots in one hour.
|
/// The number of slots in one hour.
|
||||||
pub const ONE_HOUR_SLOTS: u64 = 60 * ONE_MINUTE_SLOTS;
|
pub const ONE_HOUR_SLOTS: u64 = 60 * ONE_MINUTE_SLOTS;
|
||||||
|
|
||||||
|
/// The number of slots in 12 hours.
|
||||||
|
pub const TWELVE_HOURS_SLOTS: u64 = 12 * ONE_HOUR_SLOTS;
|
||||||
|
|
||||||
/// The number of slots in one day.
|
/// The number of slots in one day.
|
||||||
pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS;
|
pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS;
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ pub fn process_checkpoint(accounts: &[AccountInfo<'_>], _data: &[u8]) -> Program
|
|||||||
|
|
||||||
// Calculate bot fee.
|
// Calculate bot fee.
|
||||||
let mut bot_fee = 0;
|
let mut bot_fee = 0;
|
||||||
if clock.slot >= round.expires_at - ONE_DAY_SLOTS {
|
if clock.slot >= round.expires_at - TWELVE_HOURS_SLOTS {
|
||||||
// The round expires in less than 24h.
|
// The round expires in less than 12h.
|
||||||
// Anyone may checkpoint this account and collect the bot fee.
|
// Anyone may checkpoint this account and collect the bot fee.
|
||||||
bot_fee = miner.checkpoint_fee;
|
bot_fee = miner.checkpoint_fee;
|
||||||
miner.checkpoint_fee = 0;
|
miner.checkpoint_fee = 0;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ pub fn process_deploy(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResul
|
|||||||
if board.end_slot == u64::MAX {
|
if board.end_slot == u64::MAX {
|
||||||
board.start_slot = clock.slot;
|
board.start_slot = clock.slot;
|
||||||
board.end_slot = board.start_slot + 150;
|
board.end_slot = board.start_slot + 150;
|
||||||
round.expires_at = board.end_slot + ONE_WEEK_SLOTS;
|
round.expires_at = board.end_slot + ONE_DAY_SLOTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if signer is the automation executor.
|
// Check if signer is the automation executor.
|
||||||
|
|||||||
Reference in New Issue
Block a user