Skip to content

Commit

Permalink
core: add some blank lines in maintainTxIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Oct 6, 2021
1 parent 1ace060 commit 01aa6f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/blockchain.go
Expand Up @@ -2283,6 +2283,7 @@ func (bc *BlockChain) futureBlocksLoop() {
// the extra indices.
func (bc *BlockChain) maintainTxIndex(ancients uint64) {
defer bc.wg.Done()

// Before starting the actual maintenance, we need to handle a special case,
// where user might init Geth with an external ancient database. If so, we
// need to reindex all necessary transactions before starting to process any
Expand All @@ -2294,6 +2295,7 @@ func (bc *BlockChain) maintainTxIndex(ancients uint64) {
}
rawdb.IndexTransactions(bc.db, from, ancients, bc.quit)
}

// indexBlocks reindexes or unindexes transactions depending on user configuration
indexBlocks := func(tail *uint64, head uint64, done chan struct{}) {
defer func() { done <- struct{}{} }()
Expand Down Expand Up @@ -2326,6 +2328,7 @@ func (bc *BlockChain) maintainTxIndex(ancients uint64) {
rawdb.UnindexTransactions(bc.db, *tail, head-bc.txLookupLimit+1, bc.quit)
}
}

// Any reindexing done, start listening to chain events and moving the index window
var (
done chan struct{} // Non-nil if background unindexing or reindexing routine is active.
Expand Down

0 comments on commit 01aa6f7

Please sign in to comment.