diff --git a/lib/bitcoin.py b/lib/bitcoin.py index 7df4df27..4d75d0a5 100644 --- a/lib/bitcoin.py +++ b/lib/bitcoin.py @@ -264,10 +264,9 @@ def is_old_seed(seed): seed = mnemonic.normalize_text(seed) words = seed.split() try: - hex_seed = old_mnemonic.mn_decode(words) - words2 = old_mnemonic.mn_encode(hex_seed) - seed2 = ' '.join(words2) - uses_electrum_words = seed == seed2 + # checks here are deliberately left weak for legacy reasons, see #3149 + old_mnemonic.mn_decode(words) + uses_electrum_words = True except Exception: uses_electrum_words = False try: diff --git a/lib/tests/test_bitcoin.py b/lib/tests/test_bitcoin.py index 7732b7b4..94741ead 100644 --- a/lib/tests/test_bitcoin.py +++ b/lib/tests/test_bitcoin.py @@ -355,7 +355,8 @@ class Test_seeds(unittest.TestCase): ('cell dumb heartbeat north boom tease ship baby bright kingdom rare badword', ''), ('cElL DuMb hEaRtBeAt nOrTh bOoM TeAsE ShIp bAbY BrIgHt kInGdOm rArE SqUeEzE', 'old'), (' cElL DuMb hEaRtBeAt nOrTh bOoM TeAsE ShIp bAbY BrIgHt kInGdOm rArE SqUeEzE ', 'old'), - ('hurry idiot prefer sunset mention mist jaw inhale impossible kingdom rare squeeze', ''), # almost 'old' but maps to 33 hex chars + # below seed is actually 'invalid old' as it maps to 33 hex chars + ('hurry idiot prefer sunset mention mist jaw inhale impossible kingdom rare squeeze', 'old'), ('cram swing cover prefer miss modify ritual silly deliver chunk behind inform able', 'standard'), ('cram swing cover prefer miss modify ritual silly deliver chunk behind inform', ''), ('ostrich security deer aunt climb inner alpha arm mutual marble solid task', 'standard'),