mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-17 07:26:52 +00:00
saturating sub
This commit is contained in:
@@ -124,15 +124,13 @@ pub fn process_mine<'a, 'info>(
|
||||
// Apply liveness penalty.
|
||||
let t_liveness = t_target.saturating_add(TOLERANCE);
|
||||
if t.gt(&t_liveness) {
|
||||
reward = reward
|
||||
.checked_sub(
|
||||
reward
|
||||
.checked_mul(t.checked_sub(t_liveness).unwrap() as u64)
|
||||
.unwrap()
|
||||
.checked_div(ONE_MINUTE as u64)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
reward = reward.saturating_sub(
|
||||
reward
|
||||
.checked_mul(t.checked_sub(t_liveness).unwrap() as u64)
|
||||
.unwrap()
|
||||
.checked_div(ONE_MINUTE as u64)
|
||||
.unwrap(),
|
||||
);
|
||||
}
|
||||
|
||||
// Limit payout amount to whatever is left in the bus
|
||||
|
||||
Reference in New Issue
Block a user