change block height source to blockstream (#7)

This commit is contained in:
PascalR 2023-05-26 17:50:16 +02:00 committed by GitHub
parent f875282f49
commit 4841f1074f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)