add header sync to update tasks so it can be cancelled

This commit is contained in:
Victor Shyba 2019-12-09 06:51:30 -03:00 committed by Lex Berezhny
parent bff9117360
commit 4208876ef3

View file

@ -289,7 +289,7 @@ class BaseLedger(metaclass=LedgerRegistry):
asyncio.ensure_future(self.network.start()) asyncio.ensure_future(self.network.start())
await first_connection await first_connection
async with self._header_processing_lock: async with self._header_processing_lock:
await self.initial_headers_sync() await self._update_tasks.add(self.initial_headers_sync())
await self.join_network() await self.join_network()
self.network.on_connected.listen(self.join_network) self.network.on_connected.listen(self.join_network)