fix(staking): avoid the double iterator close in staking (#21823)

This commit is contained in:
cool-developer 2024-09-19 17:05:04 -04:00 committed by GitHub
parent bdda21f2f9
commit 98eb0b7cd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
}