mirror of
https://github.com/RoboSats/robosats.git
synced 2024-08-17 01:40:39 +03:00
Fix mempool url
This commit is contained in:
parent
5e58f0c8ce
commit
fe7a806d9d
13
api/utils.py
13
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user