From 3cfffdffc067cd8e30559be7b4b7ea0d1ee7685b Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Tue, 14 May 2024 03:11:47 +0000 Subject: [PATCH] max multiplier --- src/consts.rs | 2 +- src/processor/deregister.rs | 2 +- src/processor/mine.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/consts.rs b/src/consts.rs index 982faf9..bba86e8 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -57,7 +57,7 @@ static_assertions::const_assert!( /// The duration of two years, in minutes. /// Used to calculate the staking reward multiplier. -pub const TWO_YEARS: u64 = 60 * 24 * 365 * 2; +pub const ONE_YEAR: u64 = 60 * 24 * 365; /// The seed of the bus account PDA. pub const BUS: &[u8] = b"bus"; diff --git a/src/processor/deregister.rs b/src/processor/deregister.rs index ea69397..00ba60e 100644 --- a/src/processor/deregister.rs +++ b/src/processor/deregister.rs @@ -38,7 +38,7 @@ pub fn process_deregister<'a, 'info>( proof_info.realloc(0, true)?; // Send lamports to signer - **signer.lamports.borrow_mut() = signer.lamports().saturating_add(proof_info.lamports()); + **signer.lamports.borrow_mut() += proof_info.lamports(); **proof_info.lamports.borrow_mut() = 0; Ok(()) diff --git a/src/processor/mine.rs b/src/processor/mine.rs index a55132e..a422792 100644 --- a/src/processor/mine.rs +++ b/src/processor/mine.rs @@ -21,7 +21,7 @@ use crate::{ loaders::*, state::{Bus, Config, Proof}, utils::AccountDeserialize, - EPOCH_DURATION, MIN_DIFFICULTY, ONE_MINUTE, TWO_YEARS, + EPOCH_DURATION, MIN_DIFFICULTY, ONE_MINUTE, ONE_YEAR, }; /// Mine is the primary workhorse instruction of the Ore program. Its responsibilities include: @@ -114,7 +114,7 @@ pub fn process_mine<'a, 'info>( .saturating_add(ONE_MINUTE) .le(&clock.unix_timestamp) { - let upper_bound = reward.saturating_mul(TWO_YEARS); + let upper_bound = reward.saturating_mul(ONE_YEAR); let staking_reward = proof .balance .min(upper_bound)