Disable accounts squash call from bank

- It's asserting and killing testnet
- temporary solution for beacons
This commit is contained in:
Pankaj Garg
2019-03-21 22:41:39 +00:00
committed by Grimes
parent a0d940acf0
commit 7685ba2805
2 changed files with 5 additions and 1 deletions

View File

@ -727,6 +727,7 @@ impl AccountsDB {
.map_or(0, |fork_info| fork_info.transaction_count) .map_or(0, |fork_info| fork_info.transaction_count)
} }
#[allow(dead_code)]
fn remove_parents(&self, fork: Fork) -> Vec<Fork> { fn remove_parents(&self, fork: Fork) -> Vec<Fork> {
let mut info = self.fork_infos.write().unwrap(); let mut info = self.fork_infos.write().unwrap();
let fork_info = info.get_mut(&fork).unwrap(); let fork_info = info.get_mut(&fork).unwrap();
@ -743,6 +744,7 @@ impl AccountsDB {
.is_empty() .is_empty()
} }
#[allow(dead_code)]
fn get_merged_account_map( fn get_merged_account_map(
&self, &self,
fork: Fork, fork: Fork,
@ -763,6 +765,7 @@ impl AccountsDB {
} }
/// make fork a root, i.e. forget its heritage /// make fork a root, i.e. forget its heritage
#[allow(dead_code)]
fn squash(&self, fork: Fork) { fn squash(&self, fork: Fork) {
let parents = self.remove_parents(fork); let parents = self.remove_parents(fork);
@ -991,6 +994,7 @@ impl Accounts {
/// accounts starts with an empty data structure for every child/fork /// accounts starts with an empty data structure for every child/fork
/// this function squashes all the parents into this instance /// this function squashes all the parents into this instance
#[allow(dead_code)]
pub fn squash(&self, fork: Fork) { pub fn squash(&self, fork: Fork) {
assert!(!self.account_locks.lock().unwrap().contains_key(&fork)); assert!(!self.account_locks.lock().unwrap().contains_key(&fork));
self.accounts_db.squash(fork); self.accounts_db.squash(fork);

View File

@ -300,7 +300,7 @@ impl Bank {
let parents = self.parents(); let parents = self.parents();
*self.parent.write().unwrap() = None; *self.parent.write().unwrap() = None;
self.accounts().squash(self.accounts_id); // self.accounts().squash(self.accounts_id);
let parent_caches: Vec<_> = parents let parent_caches: Vec<_> = parents
.iter() .iter()