|
|
|
@ -79,7 +79,7 @@ defmodule Indexer.Fetcher.CoinBalance do |
|
|
|
|
|
|
|
|
|
unique_filtered_entries = |
|
|
|
|
Enum.filter(unique_entries, fn {_hash, block_number} -> |
|
|
|
|
block_number > first_block_to_index() |
|
|
|
|
block_number >= first_block_to_index() |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
unique_entry_count = Enum.count(unique_filtered_entries) |
|
|
|
@ -92,7 +92,7 @@ defmodule Indexer.Fetcher.CoinBalance do |
|
|
|
|
|> EthereumJSONRPC.fetch_balances(json_rpc_named_arguments) |
|
|
|
|
|> case do |
|
|
|
|
{:ok, fetched_balances} -> |
|
|
|
|
run_fetched_balances(fetched_balances, unique_entries) |
|
|
|
|
run_fetched_balances(fetched_balances, unique_filtered_entries) |
|
|
|
|
|
|
|
|
|
{:error, reason} -> |
|
|
|
|
Logger.error( |
|
|
|
@ -102,7 +102,16 @@ defmodule Indexer.Fetcher.CoinBalance do |
|
|
|
|
error_count: unique_entry_count |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
{:retry, unique_entries} |
|
|
|
|
{:retry, unique_filtered_entries} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
defp first_block_to_index do |
|
|
|
|
string_value = Application.get_env(:indexer, :first_block) |
|
|
|
|
|
|
|
|
|
case Integer.parse(string_value) do |
|
|
|
|
{integer, ""} -> integer |
|
|
|
|
_ -> 0 |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|