diff --git a/modules/apps/transfer/keeper/forwarding.go b/modules/apps/transfer/keeper/forwarding.go index 1029d6369a8..09dd15ebd9d 100644 --- a/modules/apps/transfer/keeper/forwarding.go +++ b/modules/apps/transfer/keeper/forwarding.go @@ -16,6 +16,7 @@ import ( func (k Keeper) forwardPacket(ctx sdk.Context, data types.FungibleTokenPacketDataV2, packet channeltypes.Packet, receivedCoins sdk.Coins) error { var nextForwardingPath types.Forwarding if len(data.Forwarding.Hops) > 1 { + // remove the first hop since it has been completed (this chain has received the packet) nextForwardingPath = types.NewForwarding(false, data.Forwarding.Hops[1:]...) } diff --git a/modules/apps/transfer/keeper/msg_server.go b/modules/apps/transfer/keeper/msg_server.go index 2be27e0f776..55202574157 100644 --- a/modules/apps/transfer/keeper/msg_server.go +++ b/modules/apps/transfer/keeper/msg_server.go @@ -81,6 +81,7 @@ func (k Keeper) unwindHops(ctx sdk.Context, msg *types.MsgTransfer) (*types.MsgT return nil, errorsmod.Wrap(types.ErrInvalidForwarding, "cannot unwind a native token") } var unwindHops []types.Hop + // remove the first hop in denom as it is the current port/channel on this chain for _, trace := range token.Denom.Trace[1:] { unwindHops = append(unwindHops, types.Hop{PortId: trace.PortId, ChannelId: trace.ChannelId}) //nolint: gosimple }