mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Fix exclude ARS from blockchain.info
This commit is contained in:
parent
1ecd1ec7dc
commit
0ef59ad8e8
14
api/utils.py
14
api/utils.py
@ -92,12 +92,16 @@ def get_exchange_rates(currencies):
|
|||||||
blockchain_prices = session.get(api_url).json()
|
blockchain_prices = session.get(api_url).json()
|
||||||
blockchain_rates = []
|
blockchain_rates = []
|
||||||
for currency in currencies:
|
for currency in currencies:
|
||||||
try: # If a currency is missing place a None
|
# Do not include ARS from Blockchain.info . This pricing is estimated wrongly.
|
||||||
blockchain_rates.append(
|
if currency == "ARS":
|
||||||
float(blockchain_prices[currency]["last"])
|
|
||||||
)
|
|
||||||
except Exception:
|
|
||||||
blockchain_rates.append(np.nan)
|
blockchain_rates.append(np.nan)
|
||||||
|
else:
|
||||||
|
try: # If a currency is missing place a None
|
||||||
|
blockchain_rates.append(
|
||||||
|
float(blockchain_prices[currency]["last"])
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
blockchain_rates.append(np.nan)
|
||||||
api_rates.append(blockchain_rates)
|
api_rates.append(blockchain_rates)
|
||||||
|
|
||||||
elif "yadio.io" in api_url:
|
elif "yadio.io" in api_url:
|
||||||
|
Loading…
Reference in New Issue
Block a user