Skip to content

Commit 98eb0b7

Browse files
fix(staking): avoid the double iterator close in staking (#21823)
1 parent bdda21f commit 98eb0b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

x/staking/keeper/cons_pubkey.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ func (k Keeper) GetBlockConsPubKeyRotationHistory(ctx context.Context) ([]types.
258258
if err != nil {
259259
return nil, err
260260
}
261-
defer iterator.Close()
262-
261+
// iterator would be closed in the CollectValues
263262
return indexes.CollectValues(ctx, k.RotationHistory, iterator)
264263
}
265264

0 commit comments

Comments
 (0)