Skip to content
Snippets Groups Projects
Commit c03d99cd authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by Bastian Köcher
Browse files

fix clippy (#1664)

parent 7b749405
Branches
No related merge requests found
......@@ -124,9 +124,10 @@ pub fn abort_when_account_balance_decreased<C: ChainWithBalances>(
let current_time = env.now();
// remember balances that are beyound 24h border
let time_border = current_time - DAY;
while balances.front().map(|(time, _)| *time < time_border).unwrap_or(false) {
balances.pop_front();
if let Some(time_border) = current_time.checked_sub(DAY) {
while balances.front().map(|(time, _)| *time < time_border).unwrap_or(false) {
balances.pop_front();
}
}
// read balance of the account
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment