From e0cda39ae5ebe84eb8fb0a188c9965e7dcf8dbfe Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 6 Mar 2018 17:15:14 +0100 Subject: [PATCH] only cache expensive case --- lib/wallet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/wallet.py b/lib/wallet.py index 3d5488f2c..892d66a12 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1765,15 +1765,15 @@ class Abstract_Wallet(PrintError): 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 + return result else: fiat_value = self.get_fiat_value(txid, ccy) if fiat_value is not None: - result = fiat_value + return fiat_value else: p = self.price_at_timestamp(txid, price_func) - result = p * txin_value/Decimal(COIN) - self.coin_price_cache[cache_key] = result - return result + return p * txin_value/Decimal(COIN) class Simple_Wallet(Abstract_Wallet):