diff options
author | Chris Rico <chrisrico@gmail.com> | 2017-01-01 17:38:48 -0600 |
---|---|---|
committer | Chris Rico <chrisrico@gmail.com> | 2017-01-01 18:07:13 -0600 |
commit | 3725abb540935b4b2d4cf7e31cf378e1577e0afa (patch) | |
tree | c8c9b700eeb5b966fc361363e55c9106ebf9e086 /bip39-standalone.html | |
parent | 434caecd96740bbec488429026830b5ad24f628a (diff) | |
download | BIP39-3725abb540935b4b2d4cf7e31cf378e1577e0afa.tar.gz BIP39-3725abb540935b4b2d4cf7e31cf378e1577e0afa.tar.zst BIP39-3725abb540935b4b2d4cf7e31cf378e1577e0afa.zip |
When completing a mnemonic word, return immediately if one is found in the wordlist that starts with the given word
Diffstat (limited to 'bip39-standalone.html')
-rw-r--r-- | bip39-standalone.html | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html index 2888d03..4a18657 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html | |||
@@ -18648,7 +18648,7 @@ window.Entropy = new (function() { | |||
18648 | // mnemonics is populated as required by getLanguage | 18648 | // mnemonics is populated as required by getLanguage |
18649 | var mnemonics = { "english": new Mnemonic("english") }; | 18649 | var mnemonics = { "english": new Mnemonic("english") }; |
18650 | var mnemonic = mnemonics["english"]; | 18650 | var mnemonic = mnemonics["english"]; |
18651 | var seed = null | 18651 | var seed = null; |
18652 | var bip32RootKey = null; | 18652 | var bip32RootKey = null; |
18653 | var bip32ExtendedKey = null; | 18653 | var bip32ExtendedKey = null; |
18654 | var network = bitcoin.networks.bitcoin; | 18654 | var network = bitcoin.networks.bitcoin; |
@@ -19292,6 +19292,8 @@ window.Entropy = new (function() { | |||
19292 | var closestWord = words[0]; | 19292 | var closestWord = words[0]; |
19293 | for (var i=0; i<words.length; i++) { | 19293 | for (var i=0; i<words.length; i++) { |
19294 | var comparedTo = words[i]; | 19294 | var comparedTo = words[i]; |
19295 | if (comparedTo.indexOf(word) == 0) return comparedTo; | ||
19296 | |||
19295 | var distance = Levenshtein.get(word, comparedTo); | 19297 | var distance = Levenshtein.get(word, comparedTo); |
19296 | if (distance < minDistance) { | 19298 | if (distance < minDistance) { |
19297 | closestWord = comparedTo; | 19299 | closestWord = comparedTo; |