mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 07:26:51 +00:00
saturating sub
This commit is contained in:
@@ -10,4 +10,4 @@ pub(crate) use ore_utils as utils;
|
||||
use solana_program::declare_id;
|
||||
|
||||
// declare_id!("mineRHF5r6S7HyD9SppBfVMXMavDkJsxwGesEvxZr2A");
|
||||
declare_id!("6NSA5s2mk5fJctfoKxWoewFpT4uwtZpBAVd6DHyMk8Zi");
|
||||
declare_id!("Fb9XVEimYj5KzVL6mLdbah3CGYmGP881uddBahui5RHt");
|
||||
|
||||
@@ -131,7 +131,7 @@ pub fn process_mine<'a, 'info>(
|
||||
.unwrap();
|
||||
sol_log(&format!("ratio: {}", ratio));
|
||||
if t.gt(&t_liveness) {
|
||||
let reward_diff = reward.checked_sub(ratio).unwrap();
|
||||
let reward_diff = reward.saturating_sub(ratio);
|
||||
sol_log(&format!("reward_diff: {}", reward_diff));
|
||||
reward = reward_diff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user