|
|
@ -89,9 +89,7 @@ defmodule Explorer.Chain.Supply.TokenBridge do |
|
|
|
cache_key = @cache_key |
|
|
|
cache_key = @cache_key |
|
|
|
|
|
|
|
|
|
|
|
case :ets.lookup(@ets_table, @cache_key) do |
|
|
|
case :ets.lookup(@ets_table, @cache_key) do |
|
|
|
[{^cache_key, {binary_coins, time}}] -> |
|
|
|
[{^cache_key, {coins, time}}] -> |
|
|
|
coins = :erlang.binary_to_term(binary_coins) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{coins, time} |
|
|
|
{coins, time} |
|
|
|
|
|
|
|
|
|
|
|
_ -> |
|
|
|
_ -> |
|
|
@ -105,11 +103,9 @@ defmodule Explorer.Chain.Supply.TokenBridge do |
|
|
|
|> Wei.sub(burned_coins()) |
|
|
|
|> Wei.sub(burned_coins()) |
|
|
|
|> Wei.to(:ether) |
|
|
|
|> Wei.to(:ether) |
|
|
|
|
|
|
|
|
|
|
|
binary_total_coins = :erlang.term_to_binary(current_total_coins) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
current_time = current_time() |
|
|
|
current_time = current_time() |
|
|
|
|
|
|
|
|
|
|
|
:ets.insert(@ets_table, {@cache_key, {binary_total_coins, current_time}}) |
|
|
|
:ets.insert(@ets_table, {@cache_key, {current_total_coins, current_time}}) |
|
|
|
|
|
|
|
|
|
|
|
{current_total_coins, current_time} |
|
|
|
{current_total_coins, current_time} |
|
|
|
end |
|
|
|
end |
|
|
|