From 4841f1074f522d46d3f826f684aa43508cd51590 Mon Sep 17 00:00:00 2001 From: PascalR <24775431+mroxso@users.noreply.github.com> Date: Fri, 26 May 2023 17:50:16 +0200 Subject: [PATCH] change block height source to blockstream (#7) --- main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index b4dbee5..706c6e3 100644 --- a/main.py +++ b/main.py @@ -42,11 +42,8 @@ try: while True: failCount = 0 try: - url = "https://blockchain.info/latestblock" - response = requests.get(url) - data = response.json() - block_height = data["height"] - + url = "https://blockstream.info/api/blocks/tip/height" + block_height = requests.get(url).json() if(block_height > old_block_height): message = "⚡️ " + str(block_height) + " ⚡️" print(message)