simplify currency parsing if _ is forgotten and there is 6 letters

This commit is contained in:
nicolas.dorier 2018-05-05 22:59:53 +09:00
parent 0290a5eacd
commit 3f4ec9ba80

View file

@ -45,6 +45,11 @@ namespace BTCPayServer.Rating
var currencyPair = splitted[0];
if (currencyPair.Length < 6 || currencyPair.Length > 10)
return false;
if (currencyPair.Length == 6)
{
value = new CurrencyPair(currencyPair.Substring(0,3), currencyPair.Substring(3, 3));
return true;
}
for (int i = 3; i < 5; i++)
{
var potentialCryptoName = currencyPair.Substring(0, i);