Have close_wallet hook take a wallet.
This commit is contained in:
parent
b8f2d9dfd4
commit
93d05e8cfe
|
@ -244,7 +244,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
self.print_error('close_wallet', self.wallet.storage.path)
|
self.print_error('close_wallet', self.wallet.storage.path)
|
||||||
self.wallet.storage.put('accounts_expanded', self.accounts_expanded)
|
self.wallet.storage.put('accounts_expanded', self.accounts_expanded)
|
||||||
self.wallet.stop_threads()
|
self.wallet.stop_threads()
|
||||||
run_hook('close_wallet')
|
run_hook('close_wallet', self.wallet)
|
||||||
|
|
||||||
def load_wallet(self, wallet):
|
def load_wallet(self, wallet):
|
||||||
self.wallet = wallet
|
self.wallet = wallet
|
||||||
|
|
|
@ -434,13 +434,11 @@ class LedgerPlugin(BasePlugin):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def close_wallet(self):
|
def close_wallet(self, wallet):
|
||||||
pass
|
self.client = None
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def installwizard_load_wallet(self, wallet, window):
|
def installwizard_load_wallet(self, wallet, window):
|
||||||
if type(wallet) != BTChipWallet:
|
|
||||||
return
|
|
||||||
self.load_wallet(wallet, window)
|
self.load_wallet(wallet, window)
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
|
|
|
@ -193,9 +193,9 @@ class TrezorCompatiblePlugin(BasePlugin):
|
||||||
return self.get_client().atleast_version(major, minor, patch)
|
return self.get_client().atleast_version(major, minor, patch)
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def close_wallet(self):
|
def close_wallet(self, wallet):
|
||||||
self.print_error("clear session")
|
|
||||||
if self.client:
|
if self.client:
|
||||||
|
self.print_error("clear session")
|
||||||
self.client.clear_session()
|
self.client.clear_session()
|
||||||
self.client.transport.close()
|
self.client.transport.close()
|
||||||
self.client = None
|
self.client = None
|
||||||
|
|
|
@ -124,9 +124,6 @@ class QtPlugin(TrezorPlugin):
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def installwizard_load_wallet(self, wallet, window):
|
def installwizard_load_wallet(self, wallet, window):
|
||||||
if type(wallet) != self.wallet_class:
|
|
||||||
return
|
|
||||||
wallet.plugin = self
|
|
||||||
self.load_wallet(wallet, window)
|
self.load_wallet(wallet, window)
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
|
|
Loading…
Reference in New Issue