mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 07:31:02 +00:00
paras: Prune upgrade cooldowns (#7470)
After an upgrade cooldown triggered to remove a signal we also need to prune it from the list.
This commit is contained in:
@@ -1262,7 +1262,7 @@ impl<T: Config> Pallet<T> {
|
||||
// Persist parachains into the storage explicitly.
|
||||
drop(parachains);
|
||||
|
||||
return outgoing
|
||||
outgoing
|
||||
}
|
||||
|
||||
// note replacement of the code of para with given `id`, which occured in the
|
||||
@@ -1389,9 +1389,15 @@ impl<T: Config> Pallet<T> {
|
||||
/// See `process_scheduled_upgrade_changes` for more details.
|
||||
fn process_scheduled_upgrade_cooldowns(now: T::BlockNumber) {
|
||||
UpgradeCooldowns::<T>::mutate(|upgrade_cooldowns: &mut Vec<(ParaId, T::BlockNumber)>| {
|
||||
for &(para, _) in upgrade_cooldowns.iter().take_while(|&(_, at)| at <= &now) {
|
||||
UpgradeRestrictionSignal::<T>::remove(¶);
|
||||
}
|
||||
// Remove all expired signals and also prune the cooldowns.
|
||||
upgrade_cooldowns.retain(|(para, at)| {
|
||||
if at <= &now {
|
||||
UpgradeRestrictionSignal::<T>::remove(¶);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user