Parsing NaN will actually work, need to test for it

This commit is contained in:
Rick Falkvinge
2019-03-12 22:43:14 +01:00
parent 05aa05b163
commit df20fc8811
+7 -2
View File
@@ -66,7 +66,12 @@ namespace Swarmops.Logic.Financial
try
{
string coinCode = shapeshiftRate.pair.Substring(4);
double btcRate = Double.Parse(shapeshiftRate.rate);
double btcRate = shapeshiftRate.rate;
if (Double.IsNaN(btcRate) || Double.IsInfinity(btcRate))
{
continue;
}
if (coinCode != "BCH")
{
@@ -195,7 +200,7 @@ namespace Swarmops.Logic.Financial
[Serializable]
public class ShapeshiftRateDatapoint
{
public string rate { get; set; } // changed to string to be able to decentralize "NaN" rates from Shapeshift
public double rate { get; set; } // changed to string to be able to decentralize "NaN" rates from Shapeshift
public double limit { get; set; }
public string pair { get; set; }
public double maxLimit { get; set; }