mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 21:47:18 +00:00
Fix BIP39 implementation
This commit is contained in:
@@ -853,8 +853,10 @@ public class WalletTool {
|
||||
if (seedStr.contains(" ")) {
|
||||
// Parse as mnemonic code.
|
||||
final List<String> split = ImmutableList.copyOf(Splitter.on(" ").omitEmptyStrings().split(seedStr));
|
||||
String passphrase = ""; // TODO allow user to specify a passphrase
|
||||
seed = new DeterministicSeed(split, passphrase, creationTimeSecs);
|
||||
try {
|
||||
seed = new DeterministicSeed(split, creationTimeSecs);
|
||||
seed.check();
|
||||
} catch (MnemonicException.MnemonicLengthException e) {
|
||||
System.err.println("The seed did not have 12 words in, perhaps you need quotes around it?");
|
||||
return;
|
||||
@@ -864,6 +866,9 @@ public class WalletTool {
|
||||
} catch (MnemonicException.MnemonicChecksumException e) {
|
||||
System.err.println("The seed did not pass checksumming, perhaps one of the words is wrong?");
|
||||
return;
|
||||
} catch (MnemonicException e) {
|
||||
// not reached - all subclasses handled above
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
// Parse as hex or base58
|
||||
|
||||
@@ -12,4 +12,4 @@ if [ ! -e target/bitcoinj-tools-*.jar ] || [[ "$ALWAYS_BUILD_WALLETTOOL" != "" ]
|
||||
mvn package -DskipTests
|
||||
fi
|
||||
|
||||
java -jar target/bitcoinj-tools-*.jar $*
|
||||
java -jar target/bitcoinj-tools-*.jar "$@"
|
||||
|
||||
Reference in New Issue
Block a user