Skip to content

Commit

Permalink
fix(staking): avoid the double iterator close in staking (backport #2…
Browse files Browse the repository at this point in the history
…1823) (#21824)

Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
  • Loading branch information
mergify[bot] and cool-develope committed Sep 19, 2024
1 parent a1e7ef0 commit 6bda2aa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions x/staking/keeper/cons_pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ func (k Keeper) GetBlockConsPubKeyRotationHistory(ctx context.Context) ([]types.
if err != nil {
return nil, err
}
defer iterator.Close()

// iterator would be closed in the CollectValues
return indexes.CollectValues(ctx, k.RotationHistory, iterator)
}

Expand Down

0 comments on commit 6bda2aa

Please sign in to comment.