From 0ebef8efde96b93356dafd212bb4eb8bc2ded891 Mon Sep 17 00:00:00 2001 From: FinnZhang <> Date: Mon, 20 Jul 2020 04:00:55 -0400 Subject: [PATCH] fix: add call to iterator Close method --- x/staking/keeper/delegation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 984652e8c382..b7f32c3fc921 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -273,6 +273,8 @@ func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (m // gets an iterator for all timeslices from time 0 until the current Blockheader time unbondingTimesliceIterator := k.UBDQueueIterator(ctx, ctx.BlockHeader().Time) + defer unbondingTimesliceIterator.Close() + for ; unbondingTimesliceIterator.Valid(); unbondingTimesliceIterator.Next() { timeslice := types.DVPairs{} value := unbondingTimesliceIterator.Value() @@ -474,6 +476,8 @@ func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time // gets an iterator for all timeslices from time 0 until the current Blockheader time redelegationTimesliceIterator := k.RedelegationQueueIterator(ctx, ctx.BlockHeader().Time) + defer redelegationTimesliceIterator.Close() + for ; redelegationTimesliceIterator.Valid(); redelegationTimesliceIterator.Next() { timeslice := types.DVVTriplets{} value := redelegationTimesliceIterator.Value()