Unverified Commit 2ea6bcf1 authored by Dónal Murray's avatar Dónal Murray Committed by GitHub
Browse files

[pallet_broker] Remove leases that have already expired in rotate_sale (#3213)

Leases can be force set, but since `Leases` is a `StorageValue`, if a
lease misses its sale rotation in which it should expire, it can never
be cleared.

This can happen if a lease is added with an `until` timeslice that lies
in a region whose sale has already started or has passed, even if the
timeslice itself hasn't passed.

This solves that issue in a minimal way, with all expired leases being
cleaned up in each sale rotation, not just the ones that are expiring in
the coming region.

TODO:
- [x] Write test
parent 2556e33f
Pipeline #443003 canceled with stages
in 1 hour, 11 minutes, and 31 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment