From ca5c89b0a03e9f5212570b48859965a298ed7dca Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "core: ensure txindex will be triggered at least once (#27847)" This reverts commit 01eb95af0f4b5768539e64f6fec942a1b57cecc9. --- core/blockchain.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index b0ea1ac4dcc4..cd072dd4aab5 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2421,12 +2421,6 @@ func (bc *BlockChain) skipBlock(err error, it *insertIterator) bool { func (bc *BlockChain) indexBlocks(tail *uint64, head uint64, done chan struct{}) { defer func() { close(done) }() - // If head is 0, it means the chain is just initialized and no blocks are inserted, - // so don't need to indexing anything. - if head == 0 { - return - } - // The tail flag is not existent, it means the node is just initialized // and all blocks(may from ancient store) are not indexed yet. if tail == nil { @@ -2486,14 +2480,6 @@ func (bc *BlockChain) maintainTxIndex() { defer sub.Unsubscribe() log.Info("Initialized transaction indexer", "limit", bc.TxLookupLimit()) - // Launch the initial processing if chain is not empty. This step is - // useful in these scenarios that chain has no progress and indexer - // is never triggered. - if head := rawdb.ReadHeadBlock(bc.db); head != nil { - done = make(chan struct{}) - go bc.indexBlocks(rawdb.ReadTxIndexTail(bc.db), head.NumberU64(), done) - } - for { select { case head := <-headCh: