core: fix blockchain insert report time interval calculation (#21723)

This commit is contained in:
hwanjo 2020-10-21 23:53:30 +09:00 committed by Igor Mandrigin
parent 8effe4cb28
commit 7929173dfd

View File

@ -42,7 +42,7 @@ func (st *InsertStats) report(chain []*types.Block, index int, cache common.Stor
// Fetch the timings for the batch
var (
now = mclock.Now()
elapsed = time.Duration(now) - time.Duration(st.startTime)
elapsed = now.Sub(st.startTime)
)
// If we're at the last block of the batch or report period reached, log
if index == len(chain)-1 || elapsed >= statsReportLimit {