Browse Source

wallet: don't cache NaN coin price

if NaN coin price is cached, historial acquisition prices are not shown
correctly since the historial prices are requested after the full
history is initially shown. As such, "No data" will be shown, even
though the user required using historical pricing.
3.3.3.1
Janus 6 years ago
parent
commit
73e367dc3b
  1. 3
      electrum/wallet.py

3
electrum/wallet.py

@ -1129,7 +1129,8 @@ class Abstract_Wallet(AddressSynchronizer):
return result
if self.txi.get(txid, {}) != {}:
result = self.average_price(txid, price_func, ccy) * txin_value/Decimal(COIN)
self.coin_price_cache[cache_key] = result
if not result.is_nan():
self.coin_price_cache[cache_key] = result
return result
else:
fiat_value = self.get_fiat_value(txid, ccy)

Loading…
Cancel
Save