Browse Source

set self.wallet to None in plugin constructor

283
ThomasV 10 years ago
parent
commit
f302c90649
  1. 1
      lib/plugins.py
  2. 3
      plugins/exchange_rate.py

1
lib/plugins.py

@ -71,6 +71,7 @@ class BasePlugin:
def __init__(self, config, name): def __init__(self, config, name):
self.name = name self.name = name
self.config = config self.config = config
self.wallet = None
# add self to hooks # add self to hooks
for k in dir(self): for k in dir(self):
if k in hook_names: if k in hook_names:

3
plugins/exchange_rate.py

@ -495,7 +495,6 @@ class Plugin(BasePlugin):
@hook @hook
def load_wallet(self, wallet): def load_wallet(self, wallet):
self.wallet = wallet
tx_list = {} tx_list = {}
for item in self.wallet.get_tx_history(self.wallet.storage.get("current_account", None)): for item in self.wallet.get_tx_history(self.wallet.storage.get("current_account", None)):
tx_hash, conf, is_mine, value, fee, balance, timestamp = item tx_hash, conf, is_mine, value, fee, balance, timestamp = item
@ -555,6 +554,8 @@ class Plugin(BasePlugin):
return return
if not self.resp_hist: if not self.resp_hist:
return return
if not self.wallet:
return
self.win.is_edit = True self.win.is_edit = True
self.win.history_list.setColumnCount(6) self.win.history_list.setColumnCount(6)

Loading…
Cancel
Save