Skip to content

Commit

Permalink
v 0.13.1, patch POOL + path
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelGorny committed Aug 12, 2021
1 parent 980ca84 commit b05d038
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.pawelgorny</groupId>
<artifactId>lostword</artifactId>
<version>0.13.0</version>
<version>0.13.1</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/pawelgorny/lostword/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ private void parseScript(String targetAddress) {
}
}
}
System.out.println("Using script " + DBscriptType);
if (this.coin.equals(Configuration.ETHEREUM)){
System.out.println("Using ETHEREUM");
}else {
System.out.println("Using script " + DBscriptType);
}
}

private void parsePath(String path) {
Expand Down
35 changes: 19 additions & 16 deletions src/main/java/com/pawelgorny/lostword/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,27 @@ private static Configuration readConfiguration(String file) {
words.add(line);
}
}else if (WORK.POOL.equals(work)){
if (line.startsWith(Configuration.UNKNOWN_CHAR)){
words.add(Configuration.UNKNOWN_CHAR);
wordsPool.add(new ArrayList<>(Configuration.MNEMONIC_CODE.getWordList()));
}else {
String[] potentialWords = line.split(" ");
for (int i=0; i<potentialWords.length; i++){
if (!Configuration.MNEMONIC_CODE.getWordList().contains(potentialWords[i])){
System.out.println("WORD not in BIP39 dictionary: " + potentialWords[i]);
System.exit(1);
}
}
wordsPool.add(Arrays.asList(potentialWords));
if (potentialWords.length==1){
words.add(potentialWords[0]);
}else {
if (words.size() == size) {
path = line;
}else
if (line.startsWith(Configuration.UNKNOWN_CHAR)){
words.add(Configuration.UNKNOWN_CHAR);
wordsPool.add(new ArrayList<>(Configuration.MNEMONIC_CODE.getWordList()));
}else {
String[] potentialWords = line.split(" ");
for (int i=0; i<potentialWords.length; i++){
if (!Configuration.MNEMONIC_CODE.getWordList().contains(potentialWords[i])){
System.out.println("WORD not in BIP39 dictionary: " + potentialWords[i]);
System.exit(1);
}
}
wordsPool.add(Arrays.asList(potentialWords));
if (potentialWords.length==1){
words.add(potentialWords[0]);
}else {
words.add(Configuration.UNKNOWN_CHAR);
}
}
}
}
break;
}
Expand Down

0 comments on commit b05d038

Please sign in to comment.