From c82c55450871c56ed629ec7c172c568818f22481 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 27 Apr 2020 11:19:30 +0200 Subject: [PATCH] core: panic for impossible child indexer relationship --- core/chain_indexer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/chain_indexer.go b/core/chain_indexer.go index cf9412c4b4..1bff3aee74 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -439,8 +439,8 @@ func (c *ChainIndexer) Sections() (uint64, uint64, common.Hash) { // AddChildIndexer adds a child ChainIndexer that can use the output of this one func (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer) { - if c == indexer { - return + if indexer == c { + panic("can't add indexer as a child of itself") } c.lock.Lock() defer c.lock.Unlock()