From 5c2e2f230911849572022b7a2ebb8865156502ed Mon Sep 17 00:00:00 2001 From: saneery Date: Mon, 18 Mar 2019 19:06:31 +0300 Subject: [PATCH] Added guard for check block number before fetch it --- apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex b/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex index 363f54fbed..816f1d76bf 100644 --- a/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex +++ b/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex @@ -9,6 +9,8 @@ defmodule Indexer.Block.Realtime.ConsensusEnsurer do alias Explorer.Chain.Hash alias Indexer.Block.Realtime.Fetcher + def perform(_, number, _) when not is_integer(number) or number < 0, do: :ok + def perform(%Hash{byte_count: unquote(Hash.Full.byte_count())} = block_hash, number, block_fetcher) do case Chain.hash_to_block(block_hash) do {:ok, %{consensus: true} = _block} ->