Skip to content

Commit

Permalink
Fix delete session in endblock
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Jul 27, 2023
1 parent 7d07576 commit fe7faaf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/session/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func (k *Keeper) EndBlock(ctx sdk.Context) []abcitypes.ValidatorUpdate {

// Iterate over all sessions that have become inactive at the current block time.
k.IterateSessionsForInactiveAt(ctx, ctx.BlockTime(), func(_ int, item types.Session) bool {
// Delete the session from the InactiveAt index before updating the InactiveAt value.
k.DeleteSessionForInactiveAt(ctx, item.InactiveAt, item.ID)

// If the session's status is active, set it to inactive-pending and schedule
// its next status update based on the status change delay.
if item.Status.Equal(hubtypes.StatusActive) {
Expand Down

0 comments on commit fe7faaf

Please sign in to comment.