Skip to content

Commit

Permalink
update heights & fix date parsing bug (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r authored Mar 8, 2020
1 parent 6c17b8b commit c6aa04e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 201
versionName "1.12.11 'Caerbannog'"
versionName "1.12.12 'Caerbannog'"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ private long getHeight() {
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
} catch (ParseException ex) {
}
if (height <= 0)
if ((height <= 0) && (restoreHeight.length() == 8))
try {
// is it a date without dashes?
SimpleDateFormat parser = new SimpleDateFormat("yyyyMMdd");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ static public RestoreHeight getInstance() {
blockheight.put("2019-09-01", 1913201L);
blockheight.put("2019-10-01", 1934732L);
blockheight.put("2019-11-01", 1957051L);
blockheight.put("2019-12-01", 1978433L);
blockheight.put("2020-01-01", 2001315L);
blockheight.put("2020-02-01", 2023656L);
blockheight.put("2020-03-01", 2044552L);
}

public long getHeight(String date) {
Expand Down

0 comments on commit c6aa04e

Please sign in to comment.