Merge pull request #48 from chrisrico/master

Allow for better suggestion when a partial mnemonic word is entered
This commit is contained in:
iancoleman
2017-01-04 10:41:15 +11:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -18648,7 +18648,7 @@ window.Entropy = new (function() {
// mnemonics is populated as required by getLanguage
var mnemonics = { "english": new Mnemonic("english") };
var mnemonic = mnemonics["english"];
var seed = null
var seed = null;
var bip32RootKey = null;
var bip32ExtendedKey = null;
var network = bitcoin.networks.bitcoin;
@@ -19292,6 +19292,8 @@ window.Entropy = new (function() {
var closestWord = words[0];
for (var i=0; i<words.length; i++) {
var comparedTo = words[i];
if (comparedTo.indexOf(word) == 0) return comparedTo;
var distance = Levenshtein.get(word, comparedTo);
if (distance < minDistance) {
closestWord = comparedTo;

View File

@@ -3,7 +3,7 @@
// mnemonics is populated as required by getLanguage
var mnemonics = { "english": new Mnemonic("english") };
var mnemonic = mnemonics["english"];
var seed = null
var seed = null;
var bip32RootKey = null;
var bip32ExtendedKey = null;
var network = bitcoin.networks.bitcoin;
@@ -647,6 +647,8 @@
var closestWord = words[0];
for (var i=0; i<words.length; i++) {
var comparedTo = words[i];
if (comparedTo.indexOf(word) == 0) return comparedTo;
var distance = Levenshtein.get(word, comparedTo);
if (distance < minDistance) {
closestWord = comparedTo;