|
|
|
@ -281,10 +281,14 @@ defmodule Indexer.BlockFetcher do |
|
|
|
|
|
|
|
|
|
defp chunk_range(range, size) do |
|
|
|
|
count = Enum.count(range) |
|
|
|
|
chunk_range(range, count, size) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if count <= size do |
|
|
|
|
defp chunk_range(range, count, size) when count <= size do |
|
|
|
|
[range] |
|
|
|
|
else |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
defp chunk_range(range, _, size) do |
|
|
|
|
first..last = range |
|
|
|
|
|
|
|
|
|
first |
|
|
|
@ -303,7 +307,6 @@ defmodule Indexer.BlockFetcher do |
|
|
|
|
end) |
|
|
|
|
|> Enum.reverse() |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
defp realtime_task(%{json_rpc_named_arguments: json_rpc_named_arguments} = state) do |
|
|
|
|
{:ok, latest_block_number} = EthereumJSONRPC.fetch_block_number_by_tag("latest", json_rpc_named_arguments) |
|
|
|
|