From aab6fcd508eef319c869b7934a6202c45be36f5a Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 17 Jan 2020 18:15:08 +0900 Subject: [PATCH] use coingecko if coinaverage is set --- BTCPayServer.Rating/Services/RateProviderFactory.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BTCPayServer.Rating/Services/RateProviderFactory.cs b/BTCPayServer.Rating/Services/RateProviderFactory.cs index 936b14bf3..4c2f0809b 100644 --- a/BTCPayServer.Rating/Services/RateProviderFactory.cs +++ b/BTCPayServer.Rating/Services/RateProviderFactory.cs @@ -94,6 +94,10 @@ namespace BTCPayServer.Services.Rates Providers.Add("bitbank", new BitbankRateProvider(_httpClientFactory?.CreateClient("EXCHANGE_BITBANK"))); Providers.Add("bitpay", new BitpayRateProvider(_httpClientFactory?.CreateClient("EXCHANGE_BITPAY"))); + + // Backward compatibility: coinaverage should be using coingecko to prevent stores from breaking + Providers.Add("coinaverage", new CoinGeckoRateProvider(_httpClientFactory)); + // Those exchanges make multiple requests when calling GetTickers so we remove them //DirectProviders.Add("gemini", new ExchangeSharpRateProvider("gemini", new ExchangeGeminiAPI())); //DirectProviders.Add("bitfinex", new ExchangeSharpRateProvider("bitfinex", new ExchangeBitfinexAPI())); @@ -110,7 +114,7 @@ namespace BTCPayServer.Services.Rates foreach (var supportedExchange in GetCoinGeckoSupportedExchanges()) { - if (!Providers.ContainsKey(supportedExchange.Id) && supportedExchange.Id != "coingecko") + if (!Providers.ContainsKey(supportedExchange.Id) && supportedExchange.Id != CoinGeckoRateProvider.CoinGeckoName) { var coingecko = new CoinGeckoRateProvider(_httpClientFactory) {