connector

This commit is contained in:
4tochka 2019-05-05 00:16:13 +04:00
parent 248957f7f3
commit e404867451

View File

@ -278,11 +278,7 @@ class Connector:
async def get_next_block(self):
if self.active and self.active_block.done():
if not self.get_next_block_mutex.done():
return
try:
self.get_next_block_mutex = asyncio.Future()
if self.node_last_block <= self.last_block_height + self.backlog:
d = await self.rpc.getblockcount()
if d == self.node_last_block:
@ -323,8 +319,6 @@ class Connector:
self.loop.create_task(self._new_block(block))
except Exception as err:
self.log.error("get next block failed %s" % str(err))
finally:
self.get_next_block_mutex.set_result(True)
async def _get_block_by_hash(self, hash):
self.log.debug("get block by hash %s" % hash)