66 "time"
77
88 "github.com/KuChainNetwork/kuchain/chain/constants"
9+ "github.com/KuChainNetwork/kuchain/utils/version"
910 stakingexport "github.com/KuChainNetwork/kuchain/x/staking/exported"
1011 "github.com/KuChainNetwork/kuchain/x/staking/types"
1112 sdk "github.com/cosmos/cosmos-sdk/types"
@@ -171,9 +172,11 @@ func (k Keeper) IterateUnbondingDelegations(ctx sdk.Context, fn func(index int64
171172func (k Keeper ) HasMaxUnbondingDelegationEntries (ctx sdk.Context ,
172173 delegatorAddr AccountID , validatorAddr AccountID ) bool {
173174
174- name , ok := delegatorAddr .ToName ()
175- if ok && constants .IsSystemAccount (name ) {
176- return false
175+ if ctx .BlockHeight () >= (version .DiffBlockBy051 - 5 ) {
176+ name , ok := delegatorAddr .ToName ()
177+ if ok && constants .IsSystemAccount (name ) {
178+ return false
179+ }
177180 }
178181
179182 ubd , found := k .GetUnbondingDelegation (ctx , delegatorAddr , validatorAddr )
@@ -334,10 +337,13 @@ func (k Keeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, valAddr Accoun
334337func (k Keeper ) HasReceivingRedelegation (ctx sdk.Context ,
335338 delAddr AccountID , valDstAddr AccountID ) bool {
336339
337- name , ok := delAddr .ToName ()
338- if ok && constants .IsSystemAccount (name ) {
339- return false
340+ if ctx .BlockHeight () >= (version .DiffBlockBy051 - 5 ) {
341+ name , ok := delAddr .ToName ()
342+ if ok && constants .IsSystemAccount (name ) {
343+ return false
344+ }
340345 }
346+
341347 store := ctx .KVStore (k .storeKey )
342348 prefix := types .GetREDsByDelToValDstIndexKey (delAddr , valDstAddr )
343349 iterator := sdk .KVStorePrefixIterator (store , prefix )
@@ -351,9 +357,11 @@ func (k Keeper) HasMaxRedelegationEntries(ctx sdk.Context,
351357 delegatorAddr AccountID , validatorSrcAddr ,
352358 validatorDstAddr AccountID ) bool {
353359
354- name , ok := delegatorAddr .ToName ()
355- if ok && constants .IsSystemAccount (name ) {
356- return false
360+ if ctx .BlockHeight () >= (version .DiffBlockBy051 - 5 ) {
361+ name , ok := delegatorAddr .ToName ()
362+ if ok && constants .IsSystemAccount (name ) {
363+ return false
364+ }
357365 }
358366
359367 red , found := k .GetRedelegation (ctx , delegatorAddr , validatorSrcAddr , validatorDstAddr )
0 commit comments