diff --git a/x/staking/keeper/cons_pubkey.go b/x/staking/keeper/cons_pubkey.go index e1938597fa7c..d60d4628b959 100644 --- a/x/staking/keeper/cons_pubkey.go +++ b/x/staking/keeper/cons_pubkey.go @@ -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) }