Skip to content

Commit

Permalink
silence the id validation
Browse files Browse the repository at this point in the history
  • Loading branch information
HardhatChad committed Feb 12, 2025
1 parent a468371 commit 9e688f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions program/src/rebase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ pub fn process_rebase(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResu
// Load stake account.
let stake = stake_info
.as_account_mut::<Stake>(&ore_boost_api::ID)?
.assert_mut(|s| s.boost == *boost_info.key)?
.assert_mut(|s| s.id == checkpoint.current_id)?;
.assert_mut(|s| s.boost == *boost_info.key)?;

// Silently return if the provided stake account is not the expected stake account.
if stake.id != checkpoint.current_id {
return Ok(());
}

// Distribute staker rewards according to stake weight.
if checkpoint.current_id < checkpoint.total_stakers && boost.total_deposits > 0 {
Expand Down

0 comments on commit 9e688f8

Please sign in to comment.