mirror of
https://github.com/mroxso/timechain-nostr-bot.git
synced 2025-03-29 01:31:43 +01:00
potential fix for not crashing properly
This commit is contained in:
parent
215b0ec1b7
commit
8c3c69b5da
3
main.py
3
main.py
@ -7,6 +7,7 @@ from nostr.relay_manager import RelayManager
|
||||
from nostr.message_type import ClientMessageType
|
||||
from nostr.key import PrivateKey
|
||||
|
||||
try:
|
||||
relay_manager = RelayManager()
|
||||
relay_manager.add_relay("wss://nostr.0x50.tech")
|
||||
# relay_manager.add_relay("wss://relay.damus.io")
|
||||
@ -26,7 +27,6 @@ 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()
|
||||
@ -46,4 +46,5 @@ while True:
|
||||
time.sleep(5)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
relay_manager.close_connections()
|
||||
exit(1)
|
Loading…
x
Reference in New Issue
Block a user