diff --git a/src/index.html b/src/index.html index 177d9126..8195d79e 100644 --- a/src/index.html +++ b/src/index.html @@ -24,12 +24,10 @@

Mnemonic

-

You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word contains a checksum).

-

- For more info see the +

You can enter an existing mnemonic, or generate a new random one.

+

Typing your own twelve words will probably not work how you expect, since BIP39 requires the words to have a particular structure (the last word contains a checksum). For more info see the BIP39 spec.

-

If you share the information generated by this page with anyone, they can steal your assets. @@ -211,6 +209,15 @@

Mnemonic

+
+
+
+ +
+
diff --git a/src/js/index.js b/src/js/index.js index 29aab254..008d876f 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -51,6 +51,7 @@ DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning"); DOM.phrase = $(".phrase"); DOM.autoCompute = $(".autoCompute"); + DOM.allowCustomMnemonic = $(".allowCustomMnemonic"); DOM.splitMnemonic = $(".splitMnemonic"); DOM.showSplitMnemonic = $(".showSplitMnemonic"); DOM.phraseSplit = $(".phraseSplit"); @@ -148,6 +149,7 @@ DOM.bip32Client.on("change", bip32ClientChanged); DOM.useEntropy.on("change", setEntropyVisibility); DOM.autoCompute.on("change", delayedPhraseChanged); + DOM.allowCustomMnemonic.on("change", delayedPhraseChanged); DOM.entropy.on("input", delayedEntropyChanged); DOM.entropyMnemonicLength.on("change", entropyChanged); DOM.pbkdf2Rounds.on("change", pbkdf2RoundsChanged); @@ -240,6 +242,10 @@ return DOM.autoCompute.prop("checked"); } + function isCustomMnemonicAllowed() { + return DOM.allowCustomMnemonic.prop("checked"); + } + function setEntropyVisibility() { if (isUsingOwnEntropy()) { DOM.entropyContainer.removeClass("hidden"); @@ -862,7 +868,7 @@ // Check the words are valid var properPhrase = wordArrayToPhrase(words); var isValid = mnemonic.check(properPhrase); - if (!isValid) { + if (!isValid && !isCustomMnemonicAllowed()) { return "Invalid mnemonic"; } return false; @@ -2987,7 +2993,7 @@ }, }, { - name: "LBC - Library Credits", + name: "LBC - LBRY Credits", onSelect: function() { network = libs.bitcoin.networks.lbry; setHdCoin(140); diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 72b487b1..d1da8816 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js @@ -1438,9 +1438,9 @@ it('Allows selection of Landcoin', function(done) { }; testNetwork(done, params); }); -it('Allows selection of Library Credits', function(done) { +it('Allows selection of LBRY Credits', function(done) { var params = { - selectText: "LBC - Library Credits", + selectText: "LBC - LBRY Credits", phrase: "abandon abandon ability", firstAddress: "bQJEQrHDJyHdqycB32uysh1SWn8Ln8LMdg", firstPubKey: "02abd5018c033f59f49f28ee76d93c41323890928e25c171ccc7c61ed753cde8ad",