diff --git a/pytoniq/adnl/adnl.py b/pytoniq/adnl/adnl.py index 88f90b4..9ab00b7 100644 --- a/pytoniq/adnl/adnl.py +++ b/pytoniq/adnl/adnl.py @@ -404,9 +404,9 @@ async def listen(self): peer = self.peers.get(bytes.fromhex(response['from_short']['id'])) if peer is not None: - received_confirm_seqno = response.get('confirm_seqno', 0) - if received_confirm_seqno > peer.confirm_seqno: - peer.confirm_seqno = received_confirm_seqno + received_seqno = response.get('seqno', 0) + if received_seqno > peer.confirm_seqno: + peer.confirm_seqno = received_seqno message = response.get('message') messages = response.get('messages') diff --git a/pytoniq/adnl/overlay.py b/pytoniq/adnl/overlay.py index 1082226..9468f15 100644 --- a/pytoniq/adnl/overlay.py +++ b/pytoniq/adnl/overlay.py @@ -104,13 +104,13 @@ async def _process_custom_message(self, message: dict, peer: Node): assert data[0]['overlay'] == self.overlay_id, 'Unknown overlay id received' data = data[-1] if data['@type'] == 'overlay.broadcast': - # Force broadcast spreading for the network stability. Can be removed in the future. + # Force broadcast distributing for the network stability. Can be removed in the future. # Note that this is almost takes no time to do and will be done in the background. - asyncio.create_task(self.spread_broadcast(data, ignore_errors=True)) + asyncio.create_task(self.distribute_broadcast(data, ignore_errors=True)) await self._process_custom_message_handler(data, peer) - async def spread_broadcast(self, message: dict, ignore_errors: bool = True): + async def distribute_broadcast(self, message: dict, ignore_errors: bool = True): tasks = [] peers = random.choices(list(self.peers.items()), k=3) # https://github.com/ton-blockchain/ton/blob/e30049930a7372a3c1d28a1e59956af8eb489439/overlay/overlay-broadcast.cpp#L69 for _, peer in peers: diff --git a/setup.py b/setup.py index c0ae207..8429773 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="pytoniq", - version="0.1.31", + version="0.1.32", author="Maksim Kurbatov", author_email="cyrbatoff@gmail.com", description="TON Blockchain SDK",