mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-04 04:45:16 +00:00
fix #4984
This commit is contained in:
parent
8f4967f7d0
commit
1da1f0bfea
2 changed files with 12 additions and 3 deletions
|
@ -262,6 +262,13 @@ class Daemon(DaemonThread):
|
||||||
def get_wallet(self, path):
|
def get_wallet(self, path):
|
||||||
return self.wallets.get(path)
|
return self.wallets.get(path)
|
||||||
|
|
||||||
|
def delete_wallet(self, path):
|
||||||
|
self.stop_wallet(path)
|
||||||
|
if os.path.exists(path):
|
||||||
|
os.unlink(path)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def stop_wallet(self, path):
|
def stop_wallet(self, path):
|
||||||
wallet = self.wallets.pop(path, None)
|
wallet = self.wallets.pop(path, None)
|
||||||
if not wallet: return
|
if not wallet: return
|
||||||
|
|
|
@ -2197,10 +2197,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
def _delete_wallet(self, password):
|
def _delete_wallet(self, password):
|
||||||
wallet_path = self.wallet.storage.path
|
wallet_path = self.wallet.storage.path
|
||||||
basename = os.path.basename(wallet_path)
|
basename = os.path.basename(wallet_path)
|
||||||
self.gui_object.daemon.stop_wallet(wallet_path)
|
r = self.gui_object.daemon.delete_wallet(wallet_path)
|
||||||
self.close()
|
self.close()
|
||||||
os.unlink(wallet_path)
|
if r:
|
||||||
self.show_error(_("Wallet removed: {}").format(basename))
|
self.show_error(_("Wallet removed: {}").format(basename))
|
||||||
|
else:
|
||||||
|
self.show_error(_("Wallet file not found: {}").format(basename))
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
def show_seed_dialog(self, password):
|
def show_seed_dialog(self, password):
|
||||||
|
|
Loading…
Add table
Reference in a new issue