Skip to content

Commit

Permalink
Avoid secular slip of payment time
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed May 31, 2022
1 parent 3553bde commit 13e5f77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/tgrade-tc-payments/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn end_block<Q: CustomQuery>(deps: DepsMut<Q>, env: Env) -> Result<Response, Con

let period = config.payment_period.seconds();
// Pay if current time > last_payment + period (in secs)
if last_payment.is_some() && last_payment.unwrap() + period > env.block.time.seconds() {
if last_payment.is_some() && last_payment.unwrap() + period - 3600 > env.block.time.seconds() {
// Already paid
return Ok(resp);
}
Expand Down

0 comments on commit 13e5f77

Please sign in to comment.