Skip to content

Commit

Permalink
fix: only refund opened swap
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Dec 15, 2023
1 parent 5ee5e0f commit dad1e23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/tokens/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ func EndBlocker(ctx sdk.Context, timelockKeeper timelock.Keeper, swapKeeper swap
var automaticSwap swap.AtomicSwap
swapKeeper.CDC().MustUnmarshalBinaryBare(swapIterator.Value(), &automaticSwap)
swapID := swapIterator.Key()[len(swap.HashKey):]
swapItem := swapKeeper.GetSwap(ctx, swapID)
if swapItem == nil {
continue
}
if swapItem.Status != swap.Open {
continue
}
result := swap.HandleRefundHashTimerLockedTransferAfterBCFusion(ctx, swapKeeper, swap.RefundHTLTMsg{
From: automaticSwap.From,
SwapID: swapID,
Expand Down

0 comments on commit dad1e23

Please sign in to comment.