mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
fix bug for 0 transaction wallet
0 transaction wallet would return an error when getting transaction list
This commit is contained in:
parent
7f96001463
commit
f434bac45a
1 changed files with 5 additions and 2 deletions
|
@ -345,7 +345,10 @@ class Plugin(BasePlugin):
|
||||||
if self.config.get('history_rates', 'unchecked') == "checked":
|
if self.config.get('history_rates', 'unchecked') == "checked":
|
||||||
tx_list = self.tx_list
|
tx_list = self.tx_list
|
||||||
|
|
||||||
|
try:
|
||||||
mintimestr = datetime.datetime.fromtimestamp(int(min(tx_list.items(), key=lambda x: x[1]['timestamp'])[1]['timestamp'])).strftime('%Y-%m-%d')
|
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