mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 15:10:13 +00:00
max multiplier
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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(())
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user