Skip to content

Commit f804fad

Browse files
committed
fix: ora sync message parsing during participation announcements
1 parent 77f61f0 commit f804fad

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎extensions/business/oracle_sync/sync_mixins/ora_sync_states_mixin.py‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -304,23 +304,22 @@ def _announce_and_observe_participants(self):
304304
# Check if should announce the participants this time.
305305
send_interval = self.get_announce_participants_send_interval()
306306
last_ts = self.last_time_announce_participants
307-
if last_ts is not None and self.time() - last_ts < send_interval:
308-
return
309-
310-
log_str = f"Announcing {len(self._announced_participating)} participants:"
311-
log_str += "".join([
312-
f"\n\t{self.netmon.network_node_eeid(oracle)} <{oracle}> {self.oracle_sync_get_node_local_availability(oracle)}"
313-
for oracle in self._announced_participating
314-
])
315-
self.P(log_str)
307+
if last_ts is None or self.time() - last_ts >= send_interval:
308+
log_str = f"Announcing {len(self._announced_participating)} participants:"
309+
log_str += "".join([
310+
f"\n\t{self.netmon.network_node_eeid(oracle)} <{oracle}> {self.oracle_sync_get_node_local_availability(oracle)}"
311+
for oracle in self._announced_participating
312+
])
313+
self.P(log_str)
316314

317-
oracle_data = {
318-
OracleSyncCt.ANNOUNCED_PARTICIPANTS: list(self._announced_participating),
319-
OracleSyncCt.STAGE: self._get_current_state(),
320-
}
321-
self.bc.sign(oracle_data, add_data=True, use_digest=True)
322-
self.add_payload_by_fields(oracle_data=oracle_data)
323-
self.last_time_announce_participants = self.time()
315+
oracle_data = {
316+
OracleSyncCt.ANNOUNCED_PARTICIPANTS: list(self._announced_participating),
317+
OracleSyncCt.STAGE: self._get_current_state(),
318+
}
319+
self.bc.sign(oracle_data, add_data=True, use_digest=True)
320+
self.add_payload_by_fields(oracle_data=oracle_data)
321+
self.last_time_announce_participants = self.time()
322+
# endif need to announce
324323
# endif announce participants
325324

326325
# Observe the other oracles' announcements.

‎ver.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__VER__ = '2.9.672'
1+
__VER__ = '2.9.673'
22

0 commit comments

Comments
 (0)