From d5fe15b3a559782256a376360a1f1ef4d2fc8b13 Mon Sep 17 00:00:00 2001 From: j75689 Date: Wed, 3 Jan 2024 17:49:40 +0800 Subject: [PATCH] fix: SetLatestProcessedRefundSwapKey out of loop --- plugins/tokens/plugin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/tokens/plugin.go b/plugins/tokens/plugin.go index 1987c65bc..d72674e10 100644 --- a/plugins/tokens/plugin.go +++ b/plugins/tokens/plugin.go @@ -118,9 +118,11 @@ func EndBlocker(ctx sdk.Context, timelockKeeper timelock.Keeper, swapKeeper swap } logger.Info("succeed to refund swap", "swapId", swapID, "swap", fmt.Sprintf("%+v", swapItem)) - swapKeeper.SetLatestProcessedRefundSwapKey(ctx, swapIterator.Key()) + lastProcessedRefundSwapKey = swapIterator.Key() i++ } + + swapKeeper.SetLatestProcessedRefundSwapKey(ctx, lastProcessedRefundSwapKey) } // EndBreatheBlock processes the breathe block lifecycle event.