From cfe91c67f9e44f7c8f4683a69a5589a6a217acf8 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Tue, 2 Apr 2019 23:27:18 +0000 Subject: [PATCH] Revert "Revert "Disable accounts squash call from bank"" This reverts commit f84593ad5f2eb73d9b49e2732bc6b4fb053192cb. --- runtime/src/accounts.rs | 4 ++++ runtime/src/bank.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 7cd688eeb4..64a631b7e1 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -727,6 +727,7 @@ impl AccountsDB { .map_or(0, |fork_info| fork_info.transaction_count) } + #[allow(dead_code)] fn remove_parents(&self, fork: Fork) -> Vec { let mut info = self.fork_infos.write().unwrap(); let fork_info = info.get_mut(&fork).unwrap(); @@ -743,6 +744,7 @@ impl AccountsDB { .is_empty() } + #[allow(dead_code)] fn get_merged_account_map( &self, fork: Fork, @@ -763,6 +765,7 @@ impl AccountsDB { } /// make fork a root, i.e. forget its heritage + #[allow(dead_code)] fn squash(&self, fork: Fork) { let parents = self.remove_parents(fork); @@ -991,6 +994,7 @@ impl Accounts { /// accounts starts with an empty data structure for every child/fork /// this function squashes all the parents into this instance + #[allow(dead_code)] pub fn squash(&self, fork: Fork) { assert!(!self.account_locks.lock().unwrap().contains_key(&fork)); self.accounts_db.squash(fork); diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 648c37668f..718274eb1e 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -301,7 +301,7 @@ impl Bank { let parents = self.parents(); *self.parent.write().unwrap() = None; - self.accounts().squash(self.accounts_id); + // self.accounts().squash(self.accounts_id); let parent_caches: Vec<_> = parents .iter()