diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index a4c32b10f70..1070be1b338 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -559,7 +559,7 @@ func (k *Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTime } // Retrieve callbacks from router - cbs, ok := k.PortKeeper.Route(msg.Packet.SourcePort) + cbs, ok := k.PortKeeper.AppRouter.PacketRoute(msg.Packet.SourcePort) if !ok { ctx.Logger().Error("timeout on close failed", "port-id", msg.Packet.SourcePort, "error", errorsmod.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", msg.Packet.SourcePort)) return nil, errorsmod.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", msg.Packet.SourcePort) @@ -593,10 +593,12 @@ func (k *Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTime // // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" // application logic callback. - err = cbs.OnTimeoutPacket(ctx, channelVersion, msg.Packet, relayer) - if err != nil { - ctx.Logger().Error("timeout on close failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "timeout on close callback failed")) - return nil, errorsmod.Wrap(err, "timeout on close callback failed") + for _, cb := range cbs { + err = cb.OnTimeoutPacket(ctx, channelVersion, msg.Packet, relayer) + if err != nil { + ctx.Logger().Error("timeout on close failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "timeout on close callback failed")) + return nil, errorsmod.Wrap(err, "timeout on close callback failed") + } } defer telemetry.ReportTimeoutPacket(msg.Packet, "channel-closed")