File tree 1 file changed +4
-0
lines changed
contracts/javascore/ibc/src/main/java/ibc/ics04/channel
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public String _channelOpenInit(MsgChannelOpenInit msg) {
26
26
byte [] connectionPb = connections .get (channel .getConnectionHops ().get (0 ));
27
27
Context .require (connectionPb != null , "connection does not exist" );
28
28
ConnectionEnd connection = ConnectionEnd .decode (connectionPb );
29
+ Context .require (connection .getState () == ConnectionEnd .State .STATE_OPEN ,
30
+ "connection state is not OPEN" );
29
31
30
32
Context .require (
31
33
connection .getVersions ().size () == 1 ,
@@ -54,6 +56,8 @@ public String _channelOpenTry(MsgChannelOpenTry msg) {
54
56
byte [] connectionPb = connections .get (channel .getConnectionHops ().get (0 ));
55
57
Context .require (connectionPb != null , "connection does not exist" );
56
58
ConnectionEnd connection = ConnectionEnd .decode (connectionPb );
59
+ Context .require (connection .getState () == ConnectionEnd .State .STATE_OPEN ,
60
+ "connection state is not OPEN" );
57
61
58
62
Context .require (
59
63
connection .getVersions ().size () == 1 ,
You can’t perform that action at this time.
0 commit comments