Generalize matching criteria for tombstone at boot up (#31547)

Generalize matching criteria for tombstone at bootup
This commit is contained in:
Pankaj Garg 2023-05-09 08:26:42 -07:00 committed by GitHub
parent 6a4a0418a6
commit 3845423e17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -318,7 +318,7 @@ impl LoadedProgramsForTxBatch {
pub enum LoadedProgramMatchCriteria {
DeployedOnOrAfterSlot(Slot),
Closed,
Tombstone,
NoCriteria,
}
@ -410,9 +410,7 @@ impl LoadedPrograms {
LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot) => {
program.deployment_slot >= *slot
}
LoadedProgramMatchCriteria::Closed => {
matches!(program.program, LoadedProgramType::Closed)
}
LoadedProgramMatchCriteria::Tombstone => program.is_tombstone(),
LoadedProgramMatchCriteria::NoCriteria => true,
}
}

View File

@ -4461,7 +4461,7 @@ impl Bank {
(
*pubkey,
self.program_modification_slot(pubkey)
.map_or(LoadedProgramMatchCriteria::Closed, |slot| {
.map_or(LoadedProgramMatchCriteria::Tombstone, |slot| {
LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot)
}),
)