mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
CAKE-168 | fixed getHeightByDate method
This commit is contained in:
@@ -98,14 +98,14 @@ int getHeigthByDate({DateTime date}) {
|
||||
startHeight = dates.values.toList()[dates.length - 2];
|
||||
endHeight = dates.values.toList()[dates.length - 1];
|
||||
final heightPerDay = (endHeight - startHeight) / 31;
|
||||
final daysHeight = (heightCoefficient * date.day * heightPerDay).round();
|
||||
final daysHeight = (heightCoefficient * (date.day - 1) * heightPerDay).round();
|
||||
height = endHeight + daysHeight;
|
||||
} else {
|
||||
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 * heightPerDay.round();
|
||||
final daysHeight = (date.day - 1) * heightPerDay.round();
|
||||
height = startHeight + daysHeight;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user