tPlugins manage their own wallet tracking - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit e9384f15ed80ded5fa5723b00171009c98419206
DIR parent 53f6fb9876d1b558f61df488d6440f3b5127f011
HTML Author: Neil Booth <kyuupichan@gmail.com>
Date: Sat, 14 Nov 2015 15:58:10 +0900
Plugins manage their own wallet tracking
Diffstat:
M lib/plugins.py | 4 ----
M plugins/btchipwallet.py | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
---
DIR diff --git a/lib/plugins.py b/lib/plugins.py
t@@ -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)
t@@ -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
DIR diff --git a/plugins/btchipwallet.py b/plugins/btchipwallet.py
t@@ -94,6 +94,10 @@ class Plugin(BasePlugin):
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:
return