Skip to content

Commit 001aa74

Browse files
committed
Do not ignore verification result in the Connection code
1 parent d3ee77c commit 001aa74

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/src/ibc/connection_03/manager.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ impl<'a> Manager<'a> {
9999
counterparty_client_identifier: counterparty_client_identifier.clone(),
100100
};
101101

102-
self.verify_connection_state(&connection, proof_height, proof_init, desired_identifier.clone(), &expected);
102+
if !self.verify_connection_state(&connection, proof_height, proof_init, desired_identifier.clone(), &expected) {
103+
return Err(format!("Counterparty chain's connection state verification fail. expected: {:?}", expected))
104+
}
103105

104106
if let Some(previous_connection_end) = self.query(&desired_identifier) {
105107
let expected_init = ConnectionEnd {
@@ -151,7 +153,14 @@ impl<'a> Manager<'a> {
151153
client_identifier: connection.counterparty_client_identifier.clone(),
152154
counterparty_client_identifier: connection.client_identifier.clone(),
153155
};
154-
self.verify_connection_state(&connection, proof_height, proof_try, identifier.clone(), &expected_connection);
156+
157+
if !self.verify_connection_state(&connection, proof_height, proof_try, identifier.clone(), &expected_connection)
158+
{
159+
return Err(format!(
160+
"Counterparty chain's connection state verification fail. expected: {:?}",
161+
expected_connection
162+
))
163+
}
155164

156165
connection.state = ConnectionState::OPEN;
157166
let kv_store = self.ctx.get_kv_store();

0 commit comments

Comments
 (0)