Handle removing slots during account scans (#17471)

This commit is contained in:
carllin
2021-06-14 21:04:01 -07:00
committed by GitHub
parent 471b34132e
commit ccc013e134
15 changed files with 934 additions and 319 deletions

View File

@ -2041,6 +2041,7 @@ fn main() {
if remove_stake_accounts {
for (address, mut account) in bank
.get_program_accounts(&solana_stake_program::id())
.unwrap()
.into_iter()
{
account.set_lamports(0);
@ -2074,6 +2075,7 @@ fn main() {
// Delete existing vote accounts
for (address, mut account) in bank
.get_program_accounts(&solana_vote_program::id())
.unwrap()
.into_iter()
{
account.set_lamports(0);
@ -2235,6 +2237,7 @@ fn main() {
let accounts: BTreeMap<_, _> = bank
.get_all_accounts_with_modified_slots()
.unwrap()
.into_iter()
.filter(|(pubkey, _account, _slot)| {
include_sysvars || !solana_sdk::sysvar::is_sysvar_id(pubkey)