From fe7a806d9d0b391f70244386d4f82b019738fbd0 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Wed, 10 Jan 2024 15:27:37 +0000 Subject: [PATCH] Fix mempool url --- api/utils.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/api/utils.py b/api/utils.py index 0cf70103..0eed88d9 100644 --- a/api/utils.py +++ b/api/utils.py @@ -94,17 +94,14 @@ def get_minning_fee(priority: str, preliminary_amount: int) -> int: from api.lightning.node import LNNode session = get_session() - mempool_url = ( - "http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion" - if USE_TOR - else "https://mempool.space" - ) + mempool_url = "https://mempool.space" api_path = "/api/v1/fees/recommended" try: response = session.get(mempool_url + api_path) response.raise_for_status() # Raises stored HTTPError, if one occurred data = response.json() + if priority == "suggested": value = data.get("fastestFee") elif priority == "minimum": @@ -116,7 +113,8 @@ def get_minning_fee(priority: str, preliminary_amount: int) -> int: priority, ) - except Exception: + except Exception as e: + print(e) # Fetch mining fee from LND/CLN instance if priority == "suggested": target_conf = config("SUGGESTED_TARGET_CONF", cast=int, default=2) @@ -190,7 +188,8 @@ def get_exchange_rates(currencies): blockchain_rates.append( float(blockchain_prices[currency]["last"]) ) - except Exception: + except Exception as e: + print(e) blockchain_rates.append(np.nan) api_rates.append(blockchain_rates)