Browse Source

Merge #273: Handle already existing wallet file on generate

cdde41e Handle already existing wallet file on generate (Kristaps Kaupe)
master
AdamISZ 7 years ago
parent
commit
c08adf9848
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  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