Skip to content

Commit

Permalink
Revert "core: ensure txindex will be triggered at least once (ethereu…
Browse files Browse the repository at this point in the history
…m#27847)"

This reverts commit 01eb95a.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent fbd274d commit ca5c89b
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ca5c89b

Please sign in to comment.