diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 432225bc27..799a83fbd2 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -4629,7 +4629,7 @@ impl AccountsDB { roots.sort(); info!("{}: accounts_index roots: {:?}", label, roots,); for (pubkey, account_entry) in self.accounts_index.account_maps.read().unwrap().iter() { - info!(" key: {}", pubkey); + info!(" key: {} ref_count: {}", pubkey, account_entry.ref_count(),); info!( " slots: {:?}", *account_entry.slot_list.read().unwrap() diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 5143a2896b..14e50620c0 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -78,6 +78,12 @@ pub struct AccountMapEntryInner { pub slot_list: RwLock>, } +impl AccountMapEntryInner { + pub fn ref_count(&self) -> u64 { + self.ref_count.load(Ordering::Relaxed) + } +} + #[self_referencing] pub struct ReadAccountMapEntry { owned_entry: AccountMapEntry,