Allow immediate deallocation if the decrease doesn't cross a key-share threshold

This commit is contained in:
Luke Parker 2023-10-12 23:06:20 -04:00
parent 9a1d10f4ea
commit 8dd41ee798
No known key found for this signature in database

View file

@ -480,7 +480,7 @@ pub mod pallet {
}
}
}
if !active {
if (!active) || (decrease_in_key_shares == 0) {
return Ok(true);
}
@ -491,7 +491,6 @@ pub mod pallet {
// next set ends
to_unlock_on.0 += 2;
} else {
// TODO: We can immediately free it if the deallocation doesn't cross a key share threshold
to_unlock_on.0 += 1;
}
// Increase the session by one, creating a cooldown period