Skip to content

Commit 1d3882f

Browse files
Reject Electrum mnemonics that are also valid BIP-39
1 parent e1a8e56 commit 1d3882f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Src/Autarkysoft.Bitcoin/ImprovementProposals/ElectrumMnemonic.cs

+11
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,17 @@ private void SetWordsFromEntropy(byte[] entropy)
191191
{
192192
continue;
193193
}
194+
195+
// TODO: add a new method in BIP0039 to check if the mneomonic is valid
196+
try
197+
{
198+
using BIP0039 temp = new BIP0039(normalized);
199+
continue;
200+
}
201+
catch (Exception)
202+
{
203+
}
204+
194205
if (GetMnemonicType(normalized) == MnType)
195206
{
196207
break;

0 commit comments

Comments
 (0)