From bcb811cb6592a4bd2f98d37309a0548662168db6 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Wed, 6 Mar 2024 14:59:10 +0800 Subject: [PATCH] fix: disable discontinue on testnet --- x/storage/keeper/abci.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x/storage/keeper/abci.go b/x/storage/keeper/abci.go index 01877b4b6..e0771277e 100644 --- a/x/storage/keeper/abci.go +++ b/x/storage/keeper/abci.go @@ -38,11 +38,14 @@ func EndBlocker(ctx sdk.Context, keeper Keeper) { } // delete buckets - _, err = keeper.DeleteDiscontinueBucketsUntil(ctx, blockTime, deletionMax-deleted) - if err != nil { - ctx.Logger().Error("should not happen, fail to delete buckets, err " + err.Error()) - panic("should not happen") + if ctx.BlockHeight() <= 5946511 && ctx.ChainID() == "greenfield_5600-1" { + _, err = keeper.DeleteDiscontinueBucketsUntil(ctx, blockTime, deletionMax-deleted) + if err != nil { + ctx.Logger().Error("should not happen, fail to delete buckets, err " + err.Error()) + panic("should not happen") + } } + keeper.PersistDeleteInfo(ctx) // Permission GC