Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions contracts/core/04-channel/IBCChannelHandshake.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan
if (msg_.channel.connection_hops.length != 1) {
revert IBCChannelInvalidConnectionHopsLength(msg_.channel.connection_hops.length);
}
// optimistic channel handshakes are allowed, so we can skip checking if the connection state is OPEN here.
ConnectionEnd.Data storage connection = getConnectionStorage()[msg_.channel.connection_hops[0]].connection;
if (connection.versions.length != 1) {
revert IBCChannelConnectionMultipleVersionsFound(
Expand Down Expand Up @@ -164,6 +165,9 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan
revert IBCChannelUnexpectedChannelState(channel.state);
}
ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection;
if (connection.state != ConnectionEnd.State.STATE_OPEN) {
revert IBCChannelConnectionNotOpened(channel.connection_hops[0]);
}
Channel.Data memory expectedChannel = Channel.Data({
state: Channel.State.STATE_TRYOPEN,
ordering: channel.ordering,
Expand Down