diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index c4731922dd..8602344e1f 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -1731,7 +1731,7 @@ impl ClusterInfo { Ok(()) } - fn handle_adopt_shred_version(self: &Arc, adopt_shred_version: &mut bool) { + fn handle_adopt_shred_version(&self, adopt_shred_version: &mut bool) { // Adopt the entrypoint's `shred_version` if ours is unset if *adopt_shred_version { // If gossip was given an entrypoint, look up the ContactInfo by the given @@ -1765,7 +1765,7 @@ impl ClusterInfo { } fn handle_purge( - self: &Arc, + &self, thread_pool: &ThreadPool, bank_forks: &Option>>, stakes: &HashMap, diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 58b11e9ac8..94f3fddb51 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3823,10 +3823,10 @@ impl Bank { } /// Compute all the parents of the bank including this bank itself - pub fn parents_inclusive(self: &Arc) -> Vec> { - let mut all = vec![self.clone()]; - all.extend(self.parents().into_iter()); - all + pub fn parents_inclusive(self: Arc) -> Vec> { + let mut parents = self.parents(); + parents.insert(0, self); + parents } pub fn store_account(&self, pubkey: &Pubkey, account: &Account) { @@ -4033,7 +4033,7 @@ impl Bank { } pub fn get_largest_accounts( - self: &Arc, + &self, num: usize, filter_by_address: &HashSet, filter: AccountAddressFilter, @@ -11587,7 +11587,7 @@ pub(crate) mod tests { // are currently discoverable, previous parents should have // been squashed assert_eq!( - current_minor_fork_bank.parents_inclusive().len(), + current_minor_fork_bank.clone().parents_inclusive().len(), num_new_banks + 1, );