mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-18 16:46:07 +00:00
statement-distribution: Ensure we deactivate leaves before activating (#3042)
As activation can fail, we ensure that we don't miss deactivation of leaves.
This commit is contained in:
1 parent
488cbe6896
commit
a989ddfab9
1 file changed
+3
-1
@@ -319,8 +319,10 @@ impl<R: rand::Rng> StatementDistributionSubsystem<R> {
|
||||
if let Some(ref activated) = activated {
|
||||
let mode = prospective_parachains_mode(ctx.sender(), activated.hash).await?;
|
||||
if let ProspectiveParachainsMode::Enabled { .. } = mode {
|
||||
v2::handle_active_leaves_update(ctx, state, activated, mode).await?;
|
||||
// Ensure we deactivate first, before we activate the new block.
|
||||
// Activation can fail and then we would skip the deactivation.
|
||||
v2::handle_deactivate_leaves(state, &deactivated);
|
||||
v2::handle_active_leaves_update(ctx, state, activated, mode).await?;
|
||||
} else if let ProspectiveParachainsMode::Disabled = mode {
|
||||
for deactivated in &deactivated {
|
||||
crate::legacy_v1::handle_deactivate_leaf(legacy_v1_state, *deactivated);
|
||||
|
||||
Reference in new issue
Block a user