Set drop callback on first root bank (#23999)

This commit is contained in:
carllin
2022-04-05 13:02:33 -05:00
committed by GitHub
parent 2282571493
commit 4ea59d8cb4
5 changed files with 104 additions and 59 deletions

View File

@ -6753,10 +6753,7 @@ impl Drop for Bank {
if let Some(drop_callback) = self.drop_callback.read().unwrap().0.as_ref() {
drop_callback.callback(self);
} else {
// Default case
// 1. Tests
// 2. At startup when replaying blockstore and there's no
// AccountsBackgroundService to perform cleanups yet.
// Default case for tests
self.rc
.accounts
.purge_slot(self.slot(), self.bank_id(), false);