From 29247967e7102d9f795ad242bceda77f7f07ee35 Mon Sep 17 00:00:00 2001 From: M Date: Thu, 12 Nov 2020 22:20:20 +0200 Subject: [PATCH] Fixes --- lib/monero/get_height_by_date.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/monero/get_height_by_date.dart b/lib/monero/get_height_by_date.dart index ed3d19cac..64ab7e05b 100644 --- a/lib/monero/get_height_by_date.dart +++ b/lib/monero/get_height_by_date.dart @@ -82,7 +82,7 @@ final dates = { "2020-8": 2153983, "2020-9": 2176466, "2020-10": 2198453, - "2020-11": 2221803 + "2020-11": 2220000 }; final heightCoefficient = 0.7; @@ -104,9 +104,9 @@ int getHeigthByDate({DateTime date}) { startHeight = dates[raw]; final index = dates.values.toList().indexOf(startHeight); endHeight = dates.values.toList()[index + 1]; - final heightPerDay = (endHeight - startHeight) / 31; - final daysHeight = (date.day - 1) * heightPerDay.round(); - height = startHeight + daysHeight; + final heightPerDay = ((endHeight - startHeight) / 31).round(); + final daysHeight = (date.day - 1) * heightPerDay; + height = startHeight + daysHeight - heightPerDay; } return height;