commit 83b885c702c08c2512ad81ba3eb7e71d7e6908b7
parent b9eb90955495661206deffb1ea15e5442036cc1c
Author: thomasv <thomasv@gitorious>
Date: Thu, 31 Oct 2013 15:40:10 +0100
fix mnemonic decode
Diffstat:
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py
@@ -282,6 +282,8 @@ class InstallWizard(QDialog):
try:
wallet.init_seed(seed)
except:
+ import traceback
+ traceback.print_exc(file=sys.stdout)
QMessageBox.warning(None, _('Error'), _('Incorrect seed'), _('OK'))
return
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -289,6 +289,8 @@ class Wallet:
def init_seed(self, seed):
+ import mnemonic
+
if self.seed:
raise BaseException("a seed exists")
@@ -311,19 +313,22 @@ class Wallet:
pass
words = seed.split()
- try:
- mnemonic.mn_decode(words)
- uses_electrum_words = True
- except:
- uses_electrum_words = False
-
- if uses_electrum_words and len(words) != 13:
- self.seed_version = 4
- self.seed = mnemonic.mn_encode(seed)
- else:
- assert mnemonic_hash(seed).startswith(SEED_PREFIX)
- self.seed_version = SEED_VERSION
- self.seed = seed
+ self.seed_version = 4
+ self.seed = mnemonic.mn_decode(words)
+
+ #try:
+ # mnemonic.mn_decode(words)
+ # uses_electrum_words = True
+ #except:
+ # uses_electrum_words = False
+ #
+ #if uses_electrum_words and len(words) != 13:
+ # self.seed_version = 4
+ # self.seed = mnemonic.mn_decode(words)
+ #else:
+ # assert mnemonic_hash(seed).startswith(SEED_PREFIX)
+ # self.seed_version = SEED_VERSION
+ # self.seed = seed
def save_seed(self):