mirror of
https://github.com/mroxso/timechain-nostr-bot.git
synced 2025-03-29 01:31:43 +01:00
add try catch
This commit is contained in:
parent
910231d4f4
commit
215b0ec1b7
5
main.py
5
main.py
@ -26,6 +26,7 @@ private_key = PrivateKey(bytes.fromhex(env_private_key))
|
||||
|
||||
old_block_height = 0
|
||||
while True:
|
||||
try:
|
||||
url = "https://blockchain.info/latestblock"
|
||||
response = requests.get(url)
|
||||
data = response.json()
|
||||
@ -43,4 +44,6 @@ while True:
|
||||
# relay_manager.close_connections() # NEEDED?!
|
||||
old_block_height = block_height
|
||||
time.sleep(5)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
exit(1)
|
Loading…
x
Reference in New Issue
Block a user