From 16666c2c62d0f075b573aa6b94d34c5b6bceadfd Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Mon, 29 Apr 2024 11:38:35 +0200 Subject: [PATCH] ensure packet timeout is set --- ibc-core/ics04-channel/src/handler/send_packet.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ibc-core/ics04-channel/src/handler/send_packet.rs b/ibc-core/ics04-channel/src/handler/send_packet.rs index f1c6c29b5..895ad9457 100644 --- a/ibc-core/ics04-channel/src/handler/send_packet.rs +++ b/ibc-core/ics04-channel/src/handler/send_packet.rs @@ -30,6 +30,10 @@ pub fn send_packet_validate( ctx_a: &impl SendPacketValidationContext, packet: &Packet, ) -> Result<(), ContextError> { + if !packet.timeout_height_on_b.is_set() && !packet.timeout_timestamp_on_b.is_set() { + return Err(ContextError::PacketError(PacketError::MissingTimeout)); + } + let chan_end_path_on_a = ChannelEndPath::new(&packet.port_id_on_a, &packet.chan_id_on_a); let chan_end_on_a = ctx_a.channel_end(&chan_end_path_on_a)?;