From 0e16e60e08fcfdb1b4a12f19ca4be4054a2707dc Mon Sep 17 00:00:00 2001 From: HaoranYi <219428+HaoranYi@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:42:47 -0500 Subject: [PATCH] Fix account data_len (#3276) check for zero Co-authored-by: HaoranYi --- accounts-db/src/accounts_db.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index d6bd32f96e0786..167ef150c46a15 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -8885,7 +8885,9 @@ impl AccountsDb { ); accessor.check_and_get_loaded_account(|loaded_account| { let data_len = loaded_account.data_len(); - accounts_data_len_from_duplicates += data_len; + if loaded_account.lamports() > 0 { + accounts_data_len_from_duplicates += data_len; + } num_duplicate_accounts += 1; if let Some(lamports_to_top_off) = Self::stats_for_rent_payers( pubkey,