check if value is null in token balances refetch query

pull/2704/head
Ayrat Badykov 5 years ago
parent 28c153fcdd
commit 79fa24013c
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/explorer/lib/explorer/chain.ex
  2. 2
      apps/explorer/lib/explorer/chain/address/token_balance.ex

@ -1496,7 +1496,7 @@ defmodule Explorer.Chain do
query =
from(
balance in CoinBalance,
where: is_nil(balance.value_fetched_at) or is_nil(balance.value),
where: is_nil(balance.value_fetched_at),
select: %{address_hash: balance.address_hash, block_number: balance.block_number}
)

@ -82,7 +82,7 @@ defmodule Explorer.Chain.Address.TokenBalance do
tb in TokenBalance,
join: t in Token,
on: tb.token_contract_address_hash == t.contract_address_hash,
where: is_nil(tb.value_fetched_at),
where: is_nil(tb.value_fetched_at) or is_nil(tb.value),
where: (tb.address_hash != ^@burn_address_hash and t.type != "ERC-721") or t.type == "ERC-20"
)
end

Loading…
Cancel
Save