remove epoch requirement

This commit is contained in:
Hardhat Chad
2025-05-12 14:50:41 -07:00
parent 3c4cc8f3b6
commit 379ebae250
8 changed files with 197 additions and 15 deletions

View File

@@ -14,12 +14,7 @@ pub fn process_mine(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult {
return Err(ProgramError::NotEnoughAccountKeys);
};
signer_info.is_signer()?;
let config = config_info
.as_account_mut::<Config>(&ore_api::ID)?
.assert_mut_err(
|c| t < c.last_reset_at + EPOCH_DURATION,
OreError::NeedsReset.into(),
)?;
let config = config_info.as_account_mut::<Config>(&ore_api::ID)?;
let proof = proof_info
.as_account_mut::<Proof>(&ore_api::ID)?
.assert_mut_err(
@@ -40,5 +35,10 @@ pub fn process_mine(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult {
config.best_proof = *proof_info.key;
}
// Update the proof.
proof.last_hash = solution.to_bytes();
proof.last_hash_at = t;
proof.total_hashes += 1;
Ok(())
}