tMerge pull request #611 from wozz/exchange-rate-fix - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 1e6841f45df9202a165a4d8456cdf3c747614fd8 DIR parent 960e7bc3dfd2fea3f30b6265a47ffb8faa9bde58 HTML Author: ThomasV <thomasv1@gmx.de> Date: Tue, 11 Mar 2014 13:37:45 +0100 Merge pull request #611 from wozz/exchange-rate-fix fix bug for 0 transaction wallet Diffstat: M plugins/exchange_rate.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- DIR diff --git a/plugins/exchange_rate.py b/plugins/exchange_rate.py t@@ -343,9 +343,15 @@ class Plugin(BasePlugin): def history_tab_update(self): if self.config.get('history_rates', 'unchecked') == "checked": - tx_list = self.tx_list - - mintimestr = datetime.datetime.fromtimestamp(int(min(tx_list.items(), key=lambda x: x[1]['timestamp'])[1]['timestamp'])).strftime('%Y-%m-%d') + try: + tx_list = self.tx_list + except Exception: + return + + try: + mintimestr = datetime.datetime.fromtimestamp(int(min(tx_list.items(), key=lambda x: x[1]['timestamp'])[1]['timestamp'])).strftime('%Y-%m-%d') + except ValueError: + return maxtimestr = datetime.datetime.now().strftime('%Y-%m-%d') try: resp_hist = self.exchanger.get_json('api.coindesk.com', "/v1/bpi/historical/close.json?start=" + mintimestr + "&end=" + maxtimestr)