Skip to content

Commit 91c4607

Browse files
authored
core: fix blockchain insert report time interval calculation (#21723)
1 parent 85d81b2 commit 91c4607

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/blockchain_insert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (st *insertStats) report(chain []*types.Block, index int, dirty common.Stor
4343
// Fetch the timings for the batch
4444
var (
4545
now = mclock.Now()
46-
elapsed = time.Duration(now) - time.Duration(st.startTime)
46+
elapsed = now.Sub(st.startTime)
4747
)
4848
// If we're at the last block of the batch or report period reached, log
4949
if index == len(chain)-1 || elapsed >= statsReportLimit {

0 commit comments

Comments
 (0)