Generalize matching criteria for tombstone at boot up (#31547)
Generalize matching criteria for tombstone at bootup
This commit is contained in:
parent
6a4a0418a6
commit
3845423e17
|
@ -318,7 +318,7 @@ impl LoadedProgramsForTxBatch {
|
||||||
|
|
||||||
pub enum LoadedProgramMatchCriteria {
|
pub enum LoadedProgramMatchCriteria {
|
||||||
DeployedOnOrAfterSlot(Slot),
|
DeployedOnOrAfterSlot(Slot),
|
||||||
Closed,
|
Tombstone,
|
||||||
NoCriteria,
|
NoCriteria,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,9 +410,7 @@ impl LoadedPrograms {
|
||||||
LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot) => {
|
LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot) => {
|
||||||
program.deployment_slot >= *slot
|
program.deployment_slot >= *slot
|
||||||
}
|
}
|
||||||
LoadedProgramMatchCriteria::Closed => {
|
LoadedProgramMatchCriteria::Tombstone => program.is_tombstone(),
|
||||||
matches!(program.program, LoadedProgramType::Closed)
|
|
||||||
}
|
|
||||||
LoadedProgramMatchCriteria::NoCriteria => true,
|
LoadedProgramMatchCriteria::NoCriteria => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4461,7 +4461,7 @@ impl Bank {
|
||||||
(
|
(
|
||||||
*pubkey,
|
*pubkey,
|
||||||
self.program_modification_slot(pubkey)
|
self.program_modification_slot(pubkey)
|
||||||
.map_or(LoadedProgramMatchCriteria::Closed, |slot| {
|
.map_or(LoadedProgramMatchCriteria::Tombstone, |slot| {
|
||||||
LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot)
|
LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue