mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-29 00:11:36 +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
|
return result
|
||||||
if self.txi.get(txid, {}) != {}:
|
if self.txi.get(txid, {}) != {}:
|
||||||
result = self.average_price(txid, price_func, ccy) * txin_value/Decimal(COIN)
|
result = self.average_price(txid, price_func, ccy) * txin_value/Decimal(COIN)
|
||||||
|
self.coin_price_cache[cache_key] = result
|
||||||
|
return result
|
||||||
else:
|
else:
|
||||||
fiat_value = self.get_fiat_value(txid, ccy)
|
fiat_value = self.get_fiat_value(txid, ccy)
|
||||||
if fiat_value is not None:
|
if fiat_value is not None:
|
||||||
result = fiat_value
|
return fiat_value
|
||||||
else:
|
else:
|
||||||
p = self.price_at_timestamp(txid, price_func)
|
p = self.price_at_timestamp(txid, price_func)
|
||||||
result = p * txin_value/Decimal(COIN)
|
return p * txin_value/Decimal(COIN)
|
||||||
self.coin_price_cache[cache_key] = result
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
class Simple_Wallet(Abstract_Wallet):
|
class Simple_Wallet(Abstract_Wallet):
|
||||||
|
|
Loading…
Add table
Reference in a new issue