Skip to content

Commit

Permalink
Merge pull request #308 from hyperledger-labs/audit-202409-ibc-7
Browse files Browse the repository at this point in the history
IBC-7: fix to remove state check in `timeoutPacket()` and `timeoutOnClose()`

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Nov 26, 2024
2 parents 037ce6f + 3b309dd commit c9efed2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/core/04-channel/IBCChannelPacketTimeout.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout,

function timeoutPacket(MsgTimeoutPacket calldata msg_) external {
Channel.Data storage channel = getChannelStorage()[msg_.packet.sourcePort][msg_.packet.sourceChannel].channel;
if (channel.state != Channel.State.STATE_OPEN) {
if (channel.state == Channel.State.STATE_UNINITIALIZED_UNSPECIFIED) {
revert IBCChannelUnexpectedChannelState(channel.state);
}

Expand Down Expand Up @@ -137,7 +137,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout,

function timeoutOnClose(MsgTimeoutOnClose calldata msg_) external {
Channel.Data storage channel = getChannelStorage()[msg_.packet.sourcePort][msg_.packet.sourceChannel].channel;
if (channel.state != Channel.State.STATE_OPEN) {
if (channel.state == Channel.State.STATE_UNINITIALIZED_UNSPECIFIED) {
revert IBCChannelUnexpectedChannelState(channel.state);
}

Expand Down

0 comments on commit c9efed2

Please sign in to comment.