@@ -200,18 +200,6 @@ async def _receive_loop(self):
200200 encoder .v3 .MsgType .REPORT ):
201201 raise Exception ('invalid response message type' )
202202
203- req_msg , future = self ._req_msg_futures [res_msg .id ]
204-
205- if res_msg .auth != req_msg .auth :
206- raise Exception ('invalid auth flag' )
207-
208- if res_msg .priv != req_msg .priv :
209- raise Exception ('invalid priv flag' )
210-
211- if (res_msg .type == encoder .v3 .MsgType .RESPONSE and
212- res_msg .context != req_msg .context ):
213- raise Exception ('invalid context' )
214-
215203 if (self ._authorative_engine and
216204 self ._authorative_engine .id !=
217205 res_msg .authorative_engine .id ):
@@ -237,6 +225,18 @@ async def _receive_loop(self):
237225 self ._authorative_engine = res_msg .authorative_engine
238226 self ._authorative_engine_set_time = time .monotonic ()
239227
228+ req_msg , future = self ._req_msg_futures [res_msg .id ]
229+
230+ if res_msg .auth != req_msg .auth :
231+ raise Exception ('invalid auth flag' )
232+
233+ if res_msg .priv != req_msg .priv :
234+ raise Exception ('invalid priv flag' )
235+
236+ if (res_msg .type == encoder .v3 .MsgType .RESPONSE and
237+ res_msg .context != req_msg .context ):
238+ raise Exception ('invalid context' )
239+
240240 # TODO check user
241241
242242 res = (
0 commit comments