Fixes

M committed Nov 12, 2020 at 22:20 UTC 29247967e7102d9f795ad242bceda77f7f07ee35
1 file changed +4 -4
lib/monero/get_height_by_date.dart
+4 -4
@@ -82,7 +82,7 @@ final dates = {
82 "2020-8": 2153983,
83 "2020-9": 2176466,
84 "2020-10": 2198453,
85 - "2020-11": 2221803
85 + "2020-11": 2220000
86 };
87
88 final heightCoefficient = 0.7;
@@ -104,9 +104,9 @@ int getHeigthByDate({DateTime date}) {
104 startHeight = dates[raw];
105 final index = dates.values.toList().indexOf(startHeight);
106 endHeight = dates.values.toList()[index + 1];
107 - final heightPerDay = (endHeight - startHeight) / 31;
108 - final daysHeight = (date.day - 1) * heightPerDay.round();
109 - height = startHeight + daysHeight;
107 + final heightPerDay = ((endHeight - startHeight) / 31).round();
108 + final daysHeight = (date.day - 1) * heightPerDay;
109 + height = startHeight + daysHeight - heightPerDay;
110 }
111
112 return height;