genesis head remaining number sould be zero

This commit is contained in:
maskpp 2024-04-23 10:17:29 +08:00
parent acd1eaae2c
commit f5f6b5cd9c

View file

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