mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
only cache expensive case
This commit is contained in:
parent
db0e3cd209
commit
e0cda39ae5
1 changed files with 4 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue