From 05fb95b95e81608ef3216253d95ce2c7ccb7b2cd Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:39:22 -0400 Subject: [PATCH] refactor: use now as timestamp for delta calc for pending blocks (#2586) --- crates/torii/core/src/executor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/torii/core/src/executor.rs b/crates/torii/core/src/executor.rs index 4e551b5e4f..200eb10f08 100644 --- a/crates/torii/core/src/executor.rs +++ b/crates/torii/core/src/executor.rs @@ -333,7 +333,8 @@ impl<'c> Executor<'c> { let new_tps = if new_timestamp - cursor_timestamp != 0 { num_transactions / (new_timestamp - cursor_timestamp) } else { - num_transactions + let now = Instant::now(); + num_transactions / (now.elapsed().as_secs() - cursor_timestamp) }; cursor.last_pending_block_contract_tx =