mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
close_wallet
This commit is contained in:
parent
45a55e258f
commit
5b84cbe9fb
3 changed files with 12 additions and 6 deletions
|
@ -220,6 +220,6 @@ class ElectrumGui:
|
||||||
event = QtCore.QEvent(QtCore.QEvent.Clipboard)
|
event = QtCore.QEvent(QtCore.QEvent.Clipboard)
|
||||||
self.app.sendEvent(self.app.clipboard(), event)
|
self.app.sendEvent(self.app.clipboard(), event)
|
||||||
|
|
||||||
wallet.stop_threads()
|
w.close_wallet()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -200,10 +200,12 @@ class ElectrumWindow(QMainWindow):
|
||||||
else:
|
else:
|
||||||
self.account_selector.hide()
|
self.account_selector.hide()
|
||||||
|
|
||||||
|
def close_wallet(self):
|
||||||
|
self.wallet.stop_threads()
|
||||||
|
run_hook('close_wallet')
|
||||||
|
|
||||||
def load_wallet(self, wallet):
|
def load_wallet(self, wallet):
|
||||||
import electrum
|
import electrum
|
||||||
|
|
||||||
self.wallet = wallet
|
self.wallet = wallet
|
||||||
self.update_wallet_format()
|
self.update_wallet_format()
|
||||||
# address used to create a dummy transaction and estimate transaction fee
|
# address used to create a dummy transaction and estimate transaction fee
|
||||||
|
@ -257,12 +259,11 @@ class ElectrumWindow(QMainWindow):
|
||||||
self.show_message("file not found "+ filename)
|
self.show_message("file not found "+ filename)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.wallet.stop_threads()
|
# close current wallet
|
||||||
|
self.close_wallet()
|
||||||
# create new wallet
|
# load new wallet
|
||||||
wallet = Wallet(storage)
|
wallet = Wallet(storage)
|
||||||
wallet.start_threads(self.network)
|
wallet.start_threads(self.network)
|
||||||
|
|
||||||
self.load_wallet(wallet)
|
self.load_wallet(wallet)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,11 @@ class Plugin(BasePlugin):
|
||||||
def enable(self):
|
def enable(self):
|
||||||
return BasePlugin.enable(self)
|
return BasePlugin.enable(self)
|
||||||
|
|
||||||
|
@hook
|
||||||
|
def close_wallet(self):
|
||||||
|
print_error("trezor: clear session")
|
||||||
|
self.wallet.client.clear_session()
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def load_wallet(self, wallet):
|
def load_wallet(self, wallet):
|
||||||
self.wallet = wallet
|
self.wallet = wallet
|
||||||
|
|
Loading…
Add table
Reference in a new issue