mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 02:05:19 +00:00
Merge pull request #611 from wozz/exchange-rate-fix
fix bug for 0 transaction wallet
This commit is contained in:
commit
1e6841f45d
1 changed files with 9 additions and 3 deletions
|
@ -343,9 +343,15 @@ class Plugin(BasePlugin):
|
||||||
|
|
||||||
def history_tab_update(self):
|
def history_tab_update(self):
|
||||||
if self.config.get('history_rates', 'unchecked') == "checked":
|
if self.config.get('history_rates', 'unchecked') == "checked":
|
||||||
tx_list = self.tx_list
|
try:
|
||||||
|
tx_list = self.tx_list
|
||||||
|
except Exception:
|
||||||
|
return
|
||||||
|
|
||||||
mintimestr = datetime.datetime.fromtimestamp(int(min(tx_list.items(), key=lambda x: x[1]['timestamp'])[1]['timestamp'])).strftime('%Y-%m-%d')
|
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')
|
maxtimestr = datetime.datetime.now().strftime('%Y-%m-%d')
|
||||||
try:
|
try:
|
||||||
resp_hist = self.exchanger.get_json('api.coindesk.com', "/v1/bpi/historical/close.json?start=" + mintimestr + "&end=" + maxtimestr)
|
resp_hist = self.exchanger.get_json('api.coindesk.com', "/v1/bpi/historical/close.json?start=" + mintimestr + "&end=" + maxtimestr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue