From 24fb13233d8f85bbb9c969c792bade622f9e5c54 Mon Sep 17 00:00:00 2001 From: Andrew Cravenho Date: Wed, 30 Jan 2019 19:11:04 -0500 Subject: [PATCH] Add Chain Consensus Logging --- .../lib/indexer/block/realtime/consensus_ensurer.ex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex b/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex index a49a826a6b..a01cffeae1 100644 --- a/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex +++ b/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex @@ -3,6 +3,7 @@ defmodule Indexer.Block.Realtime.ConsensusEnsurer do Triggers a refetch if a given block doesn't have consensus. """ + require Logger alias Explorer.Chain alias Explorer.Chain.Hash @@ -14,7 +15,14 @@ defmodule Indexer.Block.Realtime.ConsensusEnsurer do :ignore _ -> - # trigger refetch if consensus=false or block was not found + Logger.info(fn -> + [ + "refetch from consensus was found on block (", + to_string(number), + "). A reorg initiated." + ] + end) + #trigger refetch if consensus=false or block was not found Fetcher.fetch_and_import_block(number, block_fetcher, true) end