Fix subtraction overflow in metrics (#14290) (#14296)

(cherry picked from commit c693ffaa08)

Co-authored-by: sakridge <sakridge@gmail.com>
This commit is contained in:
mergify[bot]
2020-12-28 02:34:58 +00:00
committed by GitHub
parent b87e606626
commit eb0fd3625a
3 changed files with 7 additions and 4 deletions

View File

@@ -2723,7 +2723,7 @@ impl AccountsDB {
fn report_store_timings(&self) {
let last = self.stats.last_store_report.load(Ordering::Relaxed);
let now = solana_sdk::timing::timestamp();
if now - last > 1000
if now.saturating_sub(last) > 1000
&& self
.stats
.last_store_report