Browse Source

exchange_rate: fix #5495

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight 6 years ago
parent
commit
40e2b1d6e7
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/exchange_rate.py

6
electrum/exchange_rate.py

@ -615,11 +615,11 @@ class FxThread(ThreadJob):
rate = self.exchange.historical_rate(self.ccy, d_t)
# Frequently there is no rate for today, until tomorrow :)
# Use spot quotes in that case
if rate == 'NaN' and (datetime.today().date() - d_t.date()).days <= 2:
if rate in ('NaN', None) and (datetime.today().date() - d_t.date()).days <= 2:
rate = self.exchange.quotes.get(self.ccy, 'NaN')
if rate is None:
rate = 'NaN'
self.history_used_spot = True
if rate is None:
rate = 'NaN'
return Decimal(rate)
def historical_value_str(self, satoshis, d_t):

Loading…
Cancel
Save