Fix restoreheights prior to 2014 (#723)
* fix pre-2014 dates * update heights
This commit is contained in:
parent
12706119d3
commit
2b34454214
|
@ -378,7 +378,7 @@ public class GenerateFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getHeight() {
|
private long getHeight() {
|
||||||
long height = 0;
|
long height = -1;
|
||||||
|
|
||||||
String restoreHeight = etWalletRestoreHeight.getEditText().getText().toString().trim();
|
String restoreHeight = etWalletRestoreHeight.getEditText().getText().toString().trim();
|
||||||
if (restoreHeight.isEmpty()) return -1;
|
if (restoreHeight.isEmpty()) return -1;
|
||||||
|
@ -389,7 +389,7 @@ public class GenerateFragment extends Fragment {
|
||||||
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
|
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
|
||||||
} catch (ParseException ex) {
|
} catch (ParseException ex) {
|
||||||
}
|
}
|
||||||
if ((height <= 0) && (restoreHeight.length() == 8))
|
if ((height < 0) && (restoreHeight.length() == 8))
|
||||||
try {
|
try {
|
||||||
// is it a date without dashes?
|
// is it a date without dashes?
|
||||||
SimpleDateFormat parser = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat parser = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
@ -397,7 +397,7 @@ public class GenerateFragment extends Fragment {
|
||||||
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
|
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
|
||||||
} catch (ParseException ex) {
|
} catch (ParseException ex) {
|
||||||
}
|
}
|
||||||
if (height <= 0)
|
if (height < 0)
|
||||||
try {
|
try {
|
||||||
// or is it a height?
|
// or is it a height?
|
||||||
height = Long.parseLong(restoreHeight);
|
height = Long.parseLong(restoreHeight);
|
||||||
|
|
|
@ -121,6 +121,10 @@ public class RestoreHeight {
|
||||||
blockheight.put("2020-09-01", 2176790L);
|
blockheight.put("2020-09-01", 2176790L);
|
||||||
blockheight.put("2020-10-01", 2198370L);
|
blockheight.put("2020-10-01", 2198370L);
|
||||||
blockheight.put("2020-11-01", 2220670L);
|
blockheight.put("2020-11-01", 2220670L);
|
||||||
|
blockheight.put("2020-12-01", 2242241L);
|
||||||
|
blockheight.put("2021-01-01", 2264584L);
|
||||||
|
blockheight.put("2021-02-01", 2286892L);
|
||||||
|
blockheight.put("2021-03-01", 2307079L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getHeight(String date) {
|
public long getHeight(String date) {
|
||||||
|
|
Loading…
Reference in New Issue