chunk_range/3

pull/411/head
Luke Imhoff 6 years ago
parent 308879d2ff
commit 3a9dac846d
  1. 9
      apps/indexer/lib/indexer/block_fetcher.ex

@ -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)

Loading…
Cancel
Save