core: panic for impossible child indexer relationship

This commit is contained in:
Felix Lange 2020-04-27 11:19:30 +02:00 committed by GitHub
parent 78c3e5f42e
commit c82c554508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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