Skip to content

Commit bec99c1

Browse files
committed
chore: fix timeout_height func
1 parent 3503455 commit bec99c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pyinjective/async_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ async def close_chain_channel(self):
173173
self.cron.stop()
174174

175175
async def sync_timeout_height(self):
176-
block = await self.get_latest_block()
177-
self.timeout_height = block.block.header.height + DEFAULT_TIMEOUTHEIGHT
176+
try:
177+
block = await self.get_latest_block()
178+
self.timeout_height = block.block.header.height + DEFAULT_TIMEOUTHEIGHT
179+
except Exception as e:
180+
self.timeout_height = 0
178181

179182
# cookie helper methods
180183
async def fetch_cookie(self, type):

0 commit comments

Comments
 (0)