diff --git a/lib/plugins.py b/lib/plugins.py index 0bfb3b709..72805f78b 100644 --- a/lib/plugins.py +++ b/lib/plugins.py @@ -162,8 +162,6 @@ def _run_hook(name, always, *args): results = [] f_list = hooks.get(name, []) for p, f in f_list: - if name == 'load_wallet': - p.wallet = args[0] if always or p.is_enabled(): try: r = f(*args) @@ -173,8 +171,6 @@ def _run_hook(name, always, *args): r = False if r: results.append(r) - if name == 'close_wallet': - p.wallet = None if results: assert len(results) == 1, results diff --git a/plugins/btchipwallet.py b/plugins/btchipwallet.py index b68fe7ac1..430cf3f5d 100644 --- a/plugins/btchipwallet.py +++ b/plugins/btchipwallet.py @@ -93,6 +93,10 @@ class Plugin(BasePlugin): QMessageBox.information(window, _('Error'), _("Ledger device not detected.\nContinuing in watching-only mode."), _('OK')) self.wallet.force_watching_only = True + @hook + def close_wallet(self): + self.wallet = None + @hook def installwizard_load_wallet(self, wallet, window): if type(wallet) != BTChipWallet: