Skip to content

Commit 9f13af9

Browse files
committed
Merge remote-tracking branch 'origin/develop' into v2.3.4-candidate
2 parents 6af0eea + a6f0075 commit 9f13af9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/blockchain_insert.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
type insertStats struct {
3030
queued, processed, ignored int
3131
usedGas uint64
32-
lastIndex int
3332
startTime mclock.AbsTime
3433
}
3534

@@ -48,9 +47,9 @@ func (st *insertStats) report(chain []*types.Block, index int, snapDiffItems, sn
4847
)
4948
// If we're at the last block of the batch or report period reached, log
5049
if index == len(chain)-1 || elapsed >= statsReportLimit {
51-
// Count the number of transactions in this segment
50+
// Count the number of transactions processed in this segment
5251
var txs int
53-
for _, block := range chain[st.lastIndex : index+1] {
52+
for _, block := range chain[(index+1)-st.processed : index+1] {
5453
txs += len(block.Transactions())
5554
}
5655

@@ -94,7 +93,7 @@ func (st *insertStats) report(chain []*types.Block, index int, snapDiffItems, sn
9493
}
9594
}
9695
// Bump the stats reported to the next section
97-
*st = insertStats{startTime: now, lastIndex: index + 1}
96+
*st = insertStats{startTime: now}
9897
}
9998
}
10099

0 commit comments

Comments
 (0)