Set BankRc slot correctly when restoring a bank snapshot
This commit is contained in:
@@ -1669,9 +1669,9 @@ impl Bank {
|
||||
self.rc.accounts.clone()
|
||||
}
|
||||
|
||||
pub fn set_bank_rc(&mut self, bank_rc: &BankRc, status_cache_rc: &StatusCacheRc) {
|
||||
self.rc.accounts = bank_rc.accounts.clone();
|
||||
self.src.status_cache = status_cache_rc.status_cache.clone()
|
||||
pub fn set_bank_rc(&mut self, bank_rc: BankRc, status_cache_rc: StatusCacheRc) {
|
||||
self.rc = bank_rc;
|
||||
self.src = status_cache_rc;
|
||||
}
|
||||
|
||||
pub fn set_parent(&mut self, parent: &Arc<Bank>) {
|
||||
@@ -4610,7 +4610,7 @@ mod tests {
|
||||
let (_accounts_dir, dbank_paths) = get_temp_accounts_paths(4).unwrap();
|
||||
let ref_sc = StatusCacheRc::default();
|
||||
ref_sc.status_cache.write().unwrap().add_root(2);
|
||||
dbank.set_bank_rc(&BankRc::new(dbank_paths.clone(), 0, dbank.slot()), &ref_sc);
|
||||
dbank.set_bank_rc(BankRc::new(dbank_paths.clone(), 0, dbank.slot()), ref_sc);
|
||||
// Create a directory to simulate AppendVecs unpackaged from a snapshot tar
|
||||
let copied_accounts = TempDir::new().unwrap();
|
||||
copy_append_vecs(&bank2.rc.accounts.accounts_db, copied_accounts.path()).unwrap();
|
||||
|
Reference in New Issue
Block a user