Skip to content

Commit

Permalink
Fixs underflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
robschleusner authored and gameofpointers committed Nov 7, 2023
1 parent 3c7cba6 commit f541de6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quaistats/quaistats.go
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ func (s *Service) calculateTPS(block *types.Block) *tps {
fullBackend := s.backend.(fullNodeBackend)

for i := 0; i < int(batchesNeeded); i++ {
if currentBlock == nil || currentBlock.NumberU64() == 0 {
if currentBlock == nil {
log.Error("Encountered a nil block, stopping iteration")
break
}
Expand Down Expand Up @@ -1101,6 +1101,9 @@ func (s *Service) calculateTPS(block *types.Block) *tps {

// Add the transactions from this batch
totalTransactions1h += cachedBatchObject.(*BatchObject).TotalNoTransactions
if startBlockNum == 0 {
break
}
startBlockNum -= uint64(c_txBatchSize)
}

Expand Down

0 comments on commit f541de6

Please sign in to comment.