twallet: only do fiat history computations if specifically enabled - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit c5bedbd3ef9e5eaacf03642d7dee5ce5584b4683 DIR parent 86bc59cd6015652cd0f4dd37739e660132a480cd HTML Author: SomberNight <somber.night@protonmail.com> Date: Sat, 8 Sep 2018 19:38:38 +0200 wallet: only do fiat history computations if specifically enabled Diffstat: M electrum/wallet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- DIR diff --git a/electrum/wallet.py b/electrum/wallet.py t@@ -426,7 +426,7 @@ class Abstract_Wallet(AddressSynchronizer): else: income += value # fiat computations - if fx and fx.is_enabled(): + if fx and fx.is_enabled() and fx.get_history_config(): fiat_value = self.get_fiat_value(tx_hash, fx.ccy) fiat_default = fiat_value is None fiat_value = fiat_value if fiat_value is not None else value / Decimal(COIN) * self.price_at_timestamp(tx_hash, fx.timestamp_rate) # t@@ -462,7 +462,7 @@ class Abstract_Wallet(AddressSynchronizer): 'income': Satoshis(income), 'expenditures': Satoshis(expenditures) } - if fx and fx.is_enabled(): + if fx and fx.is_enabled() and fx.get_history_config(): unrealized = self.unrealized_gains(domain, fx.timestamp_rate, fx.ccy) summary['capital_gains'] = Fiat(capital_gains, fx.ccy) summary['fiat_income'] = Fiat(fiat_income, fx.ccy)