connector
This commit is contained in:
parent
248957f7f3
commit
e404867451
@ -278,11 +278,7 @@ class Connector:
|
|||||||
|
|
||||||
async def get_next_block(self):
|
async def get_next_block(self):
|
||||||
if self.active and self.active_block.done():
|
if self.active and self.active_block.done():
|
||||||
if not self.get_next_block_mutex.done():
|
|
||||||
return
|
|
||||||
try:
|
try:
|
||||||
self.get_next_block_mutex = asyncio.Future()
|
|
||||||
|
|
||||||
if self.node_last_block <= self.last_block_height + self.backlog:
|
if self.node_last_block <= self.last_block_height + self.backlog:
|
||||||
d = await self.rpc.getblockcount()
|
d = await self.rpc.getblockcount()
|
||||||
if d == self.node_last_block:
|
if d == self.node_last_block:
|
||||||
@ -323,8 +319,6 @@ class Connector:
|
|||||||
self.loop.create_task(self._new_block(block))
|
self.loop.create_task(self._new_block(block))
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.log.error("get next block failed %s" % str(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):
|
async def _get_block_by_hash(self, hash):
|
||||||
self.log.debug("get block by hash %s" % hash)
|
self.log.debug("get block by hash %s" % hash)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user