Browse Source

Handle already existing wallet file on generate

Before this change with wallet-tool.py you would get "ValueError:
invalid padding byte" and "jmclient.storage.StoragePasswordError: Wrong
password." exceptions, joinmarket-qt would fail silently.
master
Kristaps Kaupe 7 years ago
parent
commit
cdde41e162
  1. 2
      jmclient/jmclient/storage.py
  2. 5
      scripts/joinmarket-qt.py

2
jmclient/jmclient/storage.py

@ -94,6 +94,8 @@ class Storage(object):
self.newly_created = True
else:
raise StorageError("File not found.")
elif create:
raise StorageError("File already exists.")
else:
self._load_file(password)

5
scripts/joinmarket-qt.py

@ -1530,6 +1530,7 @@ class JMMainWindow(QMainWindow):
Initializes by syncing.
'''
if not seed:
try:
success = wallet_generate_recover_bip39("generate",
"wallets",
"wallet.jmdat",
@ -1542,6 +1543,10 @@ class JMMainWindow(QMainWindow):
JMQtMessageBox(self, "Failed to create new wallet file.",
title="Error", mbtype="warn")
return
except Exception as e:
JMQtMessageBox(self, e.args[0], title="Error", mbtype="warn")
return
JMQtMessageBox(self, 'Wallet saved to ' + self.walletname,
title="Wallet created")
self.loadWalletFromBlockchain(self.walletname, pwd=self.textpassword,

Loading…
Cancel
Save