Skip to content

Commit

Permalink
Fixed extend expiration math
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCurryMan committed May 4, 2022
1 parent 9147299 commit 7e1f34f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ pub fn handler(ctx: Context<ExtendExpirationCtx>, seconds_to_add: u64) -> Result
}

let price_to_pay = seconds_to_add
.checked_div(time_invalidator.extension_duration_seconds.expect("No extension duration"))
.expect("Division error")
.checked_mul(time_invalidator.extension_payment_amount.expect("No extension amount"))
.expect("Multiplication error");
.expect("Multiplication error")
.checked_div(time_invalidator.extension_duration_seconds.expect("No extension duration"))
.expect("Division error");

if time_invalidator.disable_partial_extension != None
&& time_invalidator.disable_partial_extension.unwrap()
Expand Down

0 comments on commit 7e1f34f

Please sign in to comment.