mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
no need to indexing if head is 0
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
60b2862a6b
commit
0dda9cf84d
1 changed files with 6 additions and 0 deletions
|
|
@ -2336,6 +2336,12 @@ func (bc *BlockChain) skipBlock(err error, it *insertIterator) bool {
|
||||||
func (bc *BlockChain) indexBlocks(tail *uint64, head uint64, done chan struct{}) {
|
func (bc *BlockChain) indexBlocks(tail *uint64, head uint64, done chan struct{}) {
|
||||||
defer func() { close(done) }()
|
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
|
// The tail flag is not existent, it means the node is just initialized
|
||||||
// and all blocks(may from ancient store) are not indexed yet.
|
// and all blocks(may from ancient store) are not indexed yet.
|
||||||
if tail == nil {
|
if tail == nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue