mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: panic for impossible child indexer relationship
This commit is contained in:
parent
78c3e5f42e
commit
c82c554508
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
// AddChildIndexer adds a child ChainIndexer that can use the output of this one
|
||||||
func (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer) {
|
func (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer) {
|
||||||
if c == indexer {
|
if indexer == c {
|
||||||
return
|
panic("can't add indexer as a child of itself")
|
||||||
}
|
}
|
||||||
c.lock.Lock()
|
c.lock.Lock()
|
||||||
defer c.lock.Unlock()
|
defer c.lock.Unlock()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue