Skip to content

Commit d17f7e7

Browse files
committed
Fix Genesis block date
1 parent 6ddcd55 commit d17f7e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/main/java/io/scalaproject/vault/util/RestoreHeight.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class RestoreHeight {
3434
static private RestoreHeight Singleton = null;
3535

3636
static public final Integer GENESISBLOCK_DATE_YEAR = 2020;
37+
static public final Integer GENESISBLOCK_DATE_MONTH = 7;
3738
static public final String GENESISBLOCK_DATE = "2020-07-31";
3839

3940
static private final String CHECKPOINT_DATE = "2020-08-07";
@@ -86,7 +87,10 @@ public long getHeight(final Date date) {
8687
cal.setTime(date);
8788
cal.add(Calendar.DAY_OF_MONTH, -4); // give it some leeway
8889

89-
if(date.before(getGenesisBLockDate()))
90+
if (cal.get(Calendar.YEAR) < GENESISBLOCK_DATE_YEAR)
91+
return 0;
92+
if ((cal.get(Calendar.YEAR) == GENESISBLOCK_DATE_YEAR) && (cal.get(Calendar.MONTH) <= GENESISBLOCK_DATE_MONTH))
93+
// before July 2020
9094
return 0;
9195

9296
Calendar query = (Calendar) cal.clone();

0 commit comments

Comments
 (0)