Skip to content

Commit

Permalink
Updates for local start
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Jan 18, 2024
1 parent 343e9a6 commit 8773e7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions convex-cli/src/main/java/convex/cli/key/KeyGenerate.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package convex.cli.key;

import java.io.Console;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import convex.cli.CLIError;
import convex.cli.Constants;
import convex.core.crypto.AKeyPair;
import convex.core.crypto.BIP39;
Expand Down
7 changes: 6 additions & 1 deletion convex-cli/src/main/java/convex/cli/local/LocalStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import convex.cli.CLIError;
import convex.cli.Constants;
import convex.cli.Helpers;
import convex.cli.Main;
Expand Down Expand Up @@ -67,7 +68,7 @@ public class LocalStart implements Runnable {
* @return List of distinct public keys
*/
private List<AKeyPair> getPeerKeyPairs(int n) {
HashSet<AKeyPair> keyPairList = new HashSet<AKeyPair>();
ArrayList<AKeyPair> keyPairList = new ArrayList<AKeyPair>();

Main mainParent = localParent.cli();

Expand Down Expand Up @@ -95,6 +96,10 @@ private List<AKeyPair> getPeerKeyPairs(int n) {
}
}

if (new HashSet<>(keyPairList).size()<keyPairList.size()) {
throw new CLIError("Duplicate peer keys provided!");
}

return new ArrayList<AKeyPair>(keyPairList);
}

Expand Down

0 comments on commit 8773e7a

Please sign in to comment.