crypto-power / cryptopower

A cross-platform SPV (DCR, BTC & LTC) privacy wallet built with go.
ISC License
35 stars 23 forks source link

fetch exchange rate api should pick a working default #551

Open dreacot opened 1 week ago

dreacot commented 1 week ago

on first startup , binance is the chosen default for the fetch exchange rate api, and if it's not available after three tries, then no exchange rate is selected.

It seems to be a better option for the fetch exchange rate function to try each available exchange api in an attempt to get a working api, and only when it's not able to find a working, it then defaults to none.

2024-06-24 08:45:26.414 [ERR] EXT: fetching ticker 1 failed: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host. Retrying in 1s

2024-06-24 08:45:27.423 [ERR] EXT: fetching ticker 2 failed: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host. Retrying in 2s

2024-06-24 08:45:29.437 [ERR] EXT: fetching ticker 3 failed: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host. Retrying in 4s

2024-06-24 08:45:33.446 [ERR] EXT: binance: Error fetching ticker: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host
vibros68 commented 3 days ago

I am working on it