genesis head remaining number sould be zero

This commit is contained in:
maskpp 2024-04-23 14:43:08 +08:00
parent f5f6b5cd9c
commit 0186bb373d

View file

@ -176,12 +176,9 @@ func (indexer *txIndexer) loop(chain *BlockChain) {
// report returns the tx indexing progress. // report returns the tx indexing progress.
func (indexer *txIndexer) report(head uint64, tail *uint64) TxIndexProgress { func (indexer *txIndexer) report(head uint64, tail *uint64) TxIndexProgress {
if head == 0 {
return TxIndexProgress{}
}
total := indexer.limit total := indexer.limit
if indexer.limit == 0 || total > head { if indexer.limit == 0 || total > head {
total = head + 1 // genesis included total = head
} }
var indexed uint64 var indexed uint64
if tail != nil { if tail != nil {