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