From 1a262603518397d1510e8fd36f6d696fb836f29c Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 31 May 2023 17:02:24 -0700 Subject: [PATCH] if no credits used, return early --- web3_proxy/src/stats/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web3_proxy/src/stats/mod.rs b/web3_proxy/src/stats/mod.rs index 0aedb115..1fe174e9 100644 --- a/web3_proxy/src/stats/mod.rs +++ b/web3_proxy/src/stats/mod.rs @@ -349,6 +349,11 @@ impl BufferedRpcQueryStats { }; // (1) Do some general bookkeeping on the user + if self.sum_credits_used == 0 { + // return early because theres no need to touch the balance table + return Ok(()); + } + let sender_balance = match balance::Entity::find() .filter(balance::Column::UserId.eq(sender_user_id)) .one(db_conn)