diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 63ed0306ba..9110e4568c 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -322,8 +322,8 @@ impl Bank { ticks_and_stakes: &mut [(u64, u64)], supermajority_stake: u64, ) -> Option { - let last_ids = self.tick_hash_queue.read().unwrap(); - last_ids.get_confirmation_timestamp(ticks_and_stakes, supermajority_stake) + let hash_queue = self.tick_hash_queue.read().unwrap(); + hash_queue.get_confirmation_timestamp(ticks_and_stakes, supermajority_stake) } /// Tell the bank which Entry IDs exist on the ledger. This function @@ -389,11 +389,11 @@ impl Bank { max_age: usize, error_counters: &mut ErrorCounters, ) -> Vec> { - let last_ids = self.tick_hash_queue.read().unwrap(); + let hash_queue = self.tick_hash_queue.read().unwrap(); txs.iter() .zip(lock_results.into_iter()) .map(|(tx, lock_res)| { - if lock_res.is_ok() && !last_ids.check_entry_id_age(tx.last_id, max_age) { + if lock_res.is_ok() && !hash_queue.check_entry_id_age(tx.last_id, max_age) { error_counters.reserve_last_id += 1; Err(BankError::LastIdNotFound) } else { @@ -791,11 +791,6 @@ impl Bank { pub fn epoch_height(&self) -> u64 { self.slot_height() / self.slots_per_epoch() } - - #[cfg(test)] - pub fn last_ids(&self) -> &RwLock { - &self.tick_hash_queue - } } #[cfg(test)] diff --git a/runtime/src/hash_queue.rs b/runtime/src/hash_queue.rs index 39445ac47b..027865f9e6 100644 --- a/runtime/src/hash_queue.rs +++ b/runtime/src/hash_queue.rs @@ -120,13 +120,6 @@ impl HashQueue { } None } - - #[cfg(test)] - pub fn clear(&mut self) { - self.entries = HashMap::new(); - self.tick_height = 0; - self.last_hash = None; - } } #[cfg(test)] mod tests {