From 78c3e5f42e16d16c1dca162e289db6c2aed1464e Mon Sep 17 00:00:00 2001 From: BurtonQin Date: Sun, 26 Apr 2020 03:46:06 -0400 Subject: [PATCH] core: add skip in AddChildIndexer() to avoid double lock --- core/chain_indexer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/chain_indexer.go b/core/chain_indexer.go index c0c2c4f7f9..cf9412c4b4 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -439,6 +439,9 @@ 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 + } c.lock.Lock() defer c.lock.Unlock()