fix(staking): add missing iterator.Close() calls (#25649)
Co-authored-by: Alex | Cosmos Labs <alex@cosmoslabs.io>
This commit is contained in:
parent
0cc7aea897
commit
7e9ad4f140
@ -77,7 +77,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
* (x/staking) [#25649](https://github.com/cosmos/cosmos-sdk/pull/25649) Add missing `defer iterator.Close()` calls in `IterateDelegatorRedelegations` and `GetRedelegations` to prevent resource leaks.
|
||||
* (mempool) [#25563](https://github.com/cosmos/cosmos-sdk/pull/25563) Cleanup sender indices in case of tx replacement.
|
||||
* (x/epochs) [#25425](https://github.com/cosmos/cosmos-sdk/pull/25425) Fix `InvokeSetHooks` being called with a nil keeper and `AppModule` containing a copy instead of a pointer (hooks set post creating the `AppModule` like with depinject didn't apply because it's a different instance).
|
||||
* (client, client/rpc, x/auth/tx) [#24551](https://github.com/cosmos/cosmos-sdk/pull/24551) Handle cancellation properly when supplying context to client methods.
|
||||
|
||||
@ -353,6 +353,7 @@ func (k Keeper) IterateDelegatorRedelegations(ctx context.Context, delegator sdk
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer iterator.Close()
|
||||
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
red, err := types.UnmarshalRED(k.cdc, iterator.Value())
|
||||
@ -560,6 +561,7 @@ func (k Keeper) GetRedelegations(ctx context.Context, delegator sdk.AccAddress,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer iterator.Close()
|
||||
|
||||
i := 0
|
||||
for ; iterator.Valid() && i < int(maxRetrieve); iterator.Next() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user